Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • When running the Java application with the java command, specify the Altibase JDBC Driver with the -cp or -classpath option
Code Block
languagebash
$ java –classpath [directory path]/Altibase.jar ClassFileName
Example)
$ java –classpath $ALTIBASE_HOME/lib/Altibase.jar HelloApp

...

  1. Using the Property class

    Code Block
    languagejava
    Properties props1 = new Properties();
    props1.put("user", "sys");
    props1.put("password", "manager");
    Connection altibaseConnection1 = DriverManager.getConnection(db_url1, props1);
  2. Connecting to URL and specifying

    Code Block
    languagejava
    String db_url1 = "jdbc:Altibase://192.168.1.111:20300/mydb?
    user=sys&password=manager";
    Connection altibaseConnection1 = DriverManager.getConnection(db_url1);

...

If necessary, the following properties can be applied to the ConnectionPool.

PropertyDescription
url

Connection string information for connecting with Altibase

jdbc:Altibase://IP:port_no/db_name

userDatabase account
passwordDatabase password
maxPoolSizeMaximum number of Connections. Default value: 10.
minPoolSizeMinimum number of Connections. Default value: 0.
initialPoolSizeInitial number of Connections. Default value: 1.
maxIdleTimeWaiting time of idle
propertyCycleWaiting time when the ConnectionPool is full (millisec)

...

Code Block
titleAltibaseFailOverConnection.java
languagejava
String db_url1 = "jdbc:Altibase://192.168.1.1111:20300/mydb?alternateservers=(192.168.1.1111:20300,192.168.1.222:20300)
 &connectionretrycount=3&connectionretrydelay=3&sessionfailover=off
 &loadbalance=off";
Properties props1 = new Properties();
props1.put("user", "sys");
props1.put("password", "manager");
Connection altibaseConnection1 = DriverManager.getConnection(db_url1,props1);

Failover-related properties are as follows.

...

In order to connect between the Altibase version simultaneously, the user must first load Altibase5.jdbc.driver.AltibaseDriver.

...

When calling the stored procedure created in the DB, write the call SQL statement as follows.

  1. Stored Procedure

    Panelcode
    languagejava
    { call procedure_name(?,?,....) }
    
    *? is a parameter corresponding to the parameter of the procedure.
  2. Stored Function

    Panelcode
    languagejava
    { call ? := function_name(?,?,....) }
    
    * The'?' before the := is a parameter indicating the result value after calling the function.

    
     '?' in () is a parameter corresponding to the parameter of a function.

The following is an example of calling store procedures and functions.

...