...
- When running the Java application with the java command, specify the Altibase JDBC Driver with the -cp or -classpath option
Code Block | ||
---|---|---|
| ||
$ java –classpath [directory path]/Altibase.jar ClassFileName Example) $ java –classpath $ALTIBASE_HOME/lib/Altibase.jar HelloApp |
...
Using the Property class
Code Block language java Properties props1 = new Properties(); props1.put("user", "sys"); props1.put("password", "manager"); Connection altibaseConnection1 = DriverManager.getConnection(db_url1, props1);
Connecting to URL and specifying
Code Block language java 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.
Property | Description |
---|---|
url | Connection string information for connecting with Altibase jdbc:Altibase://IP:port_no/db_name |
user | Database account |
password | Database password |
maxPoolSize | Maximum number of Connections. Default value: 10. |
minPoolSize | Minimum number of Connections. Default value: 0. |
initialPoolSize | Initial number of Connections. Default value: 1. |
maxIdleTime | Waiting time of idle |
propertyCycle | Waiting time when the ConnectionPool is full (millisec) |
...
Code Block | ||||
---|---|---|---|---|
| ||||
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.
Stored Procedure
Panelcode language java { call procedure_name(?,?,....) }
*? is a parameter corresponding to the parameter of the procedure.
Stored Function
Panelcode language java { 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.
...