Versions Compared

Key

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

...

At this time, if the cm protocol version of the ALTIBASE Altibase DB server and the CMP of the ALTIBASE Altibase JDBC Driver are the same, they are compatible.

...

It is recommended that the user uses the ALTIBASE Altibase JDBC Driver file, which is the same as or higher than the version of ALTIBASE Altibase DB Server, because JDBC related bugs may have been fixed as the version was upgraded.

...

If the user is developing using Eclipse, the user can add the ALTIBASE Altibase JDBC Driver to the project as follows.

Project – JRE System Library [DOCKI: J2SE-1.5]-Properties – Installed JREs – Click jre among the items – Click Edit – Add External JARs to add Altibase.jar, ALTIBASE Altibase JDBC Driver.



Setting up dataSource in SqlMapConfig file to link with

...

Altibase

The user can connect to ALTIBASE Altibase by specifying the property for ALTIBASE Altibase in the <transactionManager> tag of the SqlMapConfig file. At this time, the user can directly enter the property values in the SqlMapConfig file, or the user can create a separate properties file and load the property values written in this file for use.

The following is an example of defining properties for ALTIBASE Altibase in a properties file called db.properties, and reading these properties and using them in the SqlMapConfig file.

...

PropertyDescription
driverALTIBASE Altibase JDBC driver class name
urlConnection string information for connection with ALTIBASE Altibase Enter "jdbc:Altibase://IP:port_no/db_name"
usernameDatabase account
passwordDatabase password

...

FailOver is supported as of ALTIBASE Altibase 5.3.3. To use the FailOver function, the user can put FailOver-related properties in the part where the user writes the connection url of the dataSource. The following is an example of connecting to ALTIBASE Altibase using FailOver. Connection url part is defined in db.properties file.

...

In order to execute the above example FailOverSample project, Altibase.jar and ibatis-2.3.4.x.jar files are needed as in “Set dataSource in SqlMapConfig file to link with ALTIBASE”.

Connecting

...

Altibase 5 and Previous Versions at the Same Time

Starting with ALTIBASE Altibase 5, the ALTIBASE 5 version-specific JDBC Driver (Altibase5.jar) is provided so that one application can connect to ALTIBASE Altibase 5 and ALTIBASE Altibase 4 or ALTIBASE Altibase 3 simultaneously. By using this driver, the user can access two versions of ALTIBASE Altibase between ALTIBASE Altibase 5-ALTIBASE Altibase 4, or ALTIBASE Altibase 5-ALTIBASE Altibase 3, ALTIBASE Altibase 5.1.5-ALTIBASE Altibase 5.3.3.

In order to distinguish it from the existing Altibase.jar, Altibase5.jar for ALTIBASE Altibase 5 is required separately. In addition, in the part that is specified in the dataSource, the JDBC Driver class name should also specify Altibase5.jdbc.driver.AltibaseDriver for ALTIBASE Altibase 5 instead of the existing Altibase.jdbc.driver.AltibaseDriver.

In order to integrate with other versions of ALTIBASE Altibase in iBATIS, you need to create a separate SqlMapConfig file for each version and read each SqlMapConfig file in the application.

...

Ex) db.properties1 file of MultiVersionConneciton

Settings for ALTIBASE Altibase 5 version

Code Block
driver=Altibase5.jdbc.driver.AltibaseDriver
url=jdbc:Altibase://192.168.6.224:21129/mydb
username=sys
password=manager

Ex) db.properties2 file of MultiVersionConnection

Settings for ALTIBASE Altibase 5 and earlier

Code Block
driver=Altibase.jdbc.driver.AltibaseDriver
url=jdbc:Altibase://192.168.1.35:21129/mydb
username=sys
password=manager

Ex) MultiVersionConneciton's SqlMapConfigExample1.xml file

Settings for ALTIBASE Altibase 5 version

Code Block
<sqlMapConfig>
<properties resource="db.properties1" />
<transactionManager type="JDBC" >
   <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="${driver}"/>
      <property name="JDBC.ConnectionURL" value="${url}"/>
      <property name="JDBC.Username" value="${username}"/>
      <property name="JDBC.Password" value="${password}"/>
</dataSource>
</transactionManager>
<sqlMap resource="Person.xml" />
</sqlMapConfig>

...

In the PersonApp.java example above, to load Altibase5.jdbc.driver.AltibaseDriver before Altibase.jdbc.driver.AltibaseDriver, read the SqlMapConfigExample1.xml file using Altibase5.jdbc.driver.AltibaseDriver as JDBC.Driver first. have. The driver for ALTIBASE5 Altibase 5 must be loaded first.

In order to execute the MultiVersionConnection project included in the example, not only the ibatis-2.3.4.x.jar file used previously, but also Altibase.jar and Altibase5.jar files are needed. These files exist in the lib directory of the directory where ALTIBASE is installed ($ ALTIBASE_HOME). The user can use the Altibase5.jar file of the ALTIBASE Altibase 5 version and the Altibase.jar file of the previous version.

...