AnsweredAssumed Answered

How to call JDBC virtual service remotely from java client application

Question asked by AVSDevTest on Apr 12, 2016
Latest reply on May 11, 2018 by wombatojad

Hi All,

 

I need your help on how to call JDBC virtual service remotely from java client application using lisasim driver. I am getting below error.

 

Connection Details in Java Class -

 

private static final String DB_DRIVER = "com.itko.lisa.vse.jdbc.driver.Driver";

private static final String DB_CONNECTION = "jdbc:lisasim:driver=com.mysql.jdbc.Driver;jdbcSimPort=8707;url=jdbc:mysql://localhost:3306/sample";

 

Console Output -

 

[FATAL] No available port

Exception in thread "LISA JDBC Simulation Driver -- Read" java.lang.RuntimeException: There are no ports available in the range 8707-8707

  at com.itko.lisa.vse.jdbc.driver.DriverController.run(DriverController.java:159)

  at java.lang.Thread.run(Unknown Source)

java.sql.SQLException: Nested exception attempting to create a connection.

URL: jdbc:mysql://localhost:3306/sample

Properties:

    user=root

    password=****

  at com.itko.lisa.vse.jdbc.driver.Driver.getRealConnection(Driver.java:676)

  at com.itko.lisa.vse.jdbc.driver.Driver.connect(Driver.java:549)

  at java.sql.DriverManager.getConnection(Unknown Source)

  at java.sql.DriverManager.getConnection(Unknown Source)

  at JDBCTest.getDBConnection(JDBCTest.java:61)

  at JDBCTest.selectRecordsFromDbUserTable(JDBCTest.java:33)

  at JDBCTest.main(JDBCTest.java:20)

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

 

Thanks.

Outcomes