0

I am very new to Advantage Database Server.

I am trying to connect to a ADS database using Java. Please give me a step by step solution how to do this.

I installed the necessary JAR file, but still can not connect.

Here is my connection code.

Connection.java

public Connection getConnection() {
    Connection conn = null;
    try {
        Driver dr = (Driver) Class.forName(
          "com.extendedsystems.jdbc.advantage.ADSDriver"
        ).newInstance();
        System.out.println(
              dr.getClass() 
            + " getMajorVersion() **" 
            + Integer.toString( dr.getMajorVersion() )
            + "  .getMinorVersion() **" 
            + Integer.toString( dr.getMinorVersion() )
        );
        conn = DriverManager.getConnection(
          "jdbc:extendedsystems:advantage://server:6262;
                  catalog =C:\\Program Files (x86)\Advantage 11.10\\testDemoExample.add","adssys","adssys"
        );
    } catch (Exception er) {
        er.printStackTrace();
    }
    return conn;
}

PS: Maybe this question is already been asked before, but i could not find a proper solution.

Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113
ketan110
  • 171
  • 1
  • 1
  • 6

1 Answers1

0

Remove "testDemoExample.add" from catalog path if you are using free tables and if you are using database table, change \\ to // in catalog path.