cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Getting data from MSSQL to Jlink

akok
11-Garnet

Getting data from MSSQL to Jlink

Hello everyone,

 

Have any of you tried the access a MS SQL database from Jlink?

I have be trying but having troubles to connect.

If you have any experience please let me know.

 

Allan

 

 

3 REPLIES 3
VladimirN
24-Ruby II
(To:akok)

akok
11-Garnet
(To:VladimirN)

I have problems with finding a suitable driver, but i compiles well.

I trying with the Microsoft driver.

akok
11-Garnet
(To:akok)

It seems to, I can't get the Microsoft driver to load.

I use this code:Connection connection = null;
String url = "jdbc:sqlserver://xxxxxx\\DTW:63825;databaseName=DataWarehouse;encrypt=false;trustServerCertificate=false;loginTimeout=30;";
Statement stmt = null;
ResultSet result = null;
String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String databaseUserName = "xx";
String databasePassword = "xx";

try {
  // Class.forName(driver);
  connection = DriverManager.getConnection(url, databaseUserName, databasePassword);

} catch (SQLException ex) {
} finally {
  try {
    if (connection != null && !connection.isClosed()) {
      connection.close();
    }
  } catch (SQLException ex) {
  }
}

 

Here I got no suitable driver found.

If I also have Class.forName(driver); added I got no class found.

I have the sqldriver in my classpath.

 

Any ideas?

 

 

Top Tags