Six Stars

Can You See a JDBC String a Data Source Uses to Connect?

Is there a way that I can see the JDBC connection that a data source uses to connect? In some cases I want to check it to see if it is sending the correct connection string. 

  • Data Integration
2 REPLIES
Eleven Stars

Re: Can You See a JDBC String a Data Source Uses to Connect?

You can do this using a bit of Java if you are using a Connection component. Let's say you are using a tMSSqlConnection component called tMSSqlConnection_1. You cab use a tJava with the code below to interrogate the connection and get the URL. To use the code below for other DBs simply change the connection component name section of the code.

 

java.sql.Connection conn_tMSSqlConnection_1 = (java.sql.Connection)globalMap.get("conn_tMSSqlConnection_1");

System.out.println(conn_tMSSqlConnection_1.getMetaData().getURL());
Rilhia Solutions
Highlighted
Eleven Stars

Re: Can You See a JDBC String a Data Source Uses to Connect?

You can do this using a bit of Java if you are using a Connection component. Let's say you are using a tMSSqlConnection component called tMSSqlConnection_1. You cab use a tJava with the code below to interrogate the connection and get the URL. To use the code below for other DBs simply change the connection component name section of the code.

 

java.sql.Connection conn_tMSSqlConnection_1 = (java.sql.Connection)globalMap.get("conn_tMSSqlConnection_1");

System.out.println(conn_tMSSqlConnection_1.getMetaData().getURL());

 

 

Rilhia Solutions