Micro Focus QTP (UFT) Forums
JDBC connection for UFT - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: JDBC connection for UFT (/Thread-JDBC-connection-for-UFT)



JDBC connection for UFT - Anjali09 - 10-05-2016

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