10-05-2016, 02:19 PM
Hi,
I am trying to connect to the JDBC database server using UFT.
But i am getting all kinds of error.
Below is code that i am using
import java.sql.*;
import java.math.*;
import oracle.jdbc.pool.OracleDataSource;
OracleDataSource ods = new OracleDataSource();
ods.setUser("<user>");
ods.setPassword("<pwd>");
ods.setURL("jdbc:oracle:thin:@<database name>");
Connection conn =
new oracle.jdbc.OracleDriver().defaultConnection();
Connection conn = ods.getConnection();
It is giving me syntax error for import java.sql.*;
Also when using the connection string in API test than UFT is not able to find the drivers. Please help.
Regards,
Anjali
I am trying to connect to the JDBC database server using UFT.
But i am getting all kinds of error.
Below is code that i am using
import java.sql.*;
import java.math.*;
import oracle.jdbc.pool.OracleDataSource;
OracleDataSource ods = new OracleDataSource();
ods.setUser("<user>");
ods.setPassword("<pwd>");
ods.setURL("jdbc:oracle:thin:@<database name>");
Connection conn =
new oracle.jdbc.OracleDriver().defaultConnection();
Connection conn = ods.getConnection();
It is giving me syntax error for import java.sql.*;
Also when using the connection string in API test than UFT is not able to find the drivers. Please help.
Regards,
Anjali