Hibernate – setting currentSchema using URL for DB2 in AS400

databasedb2hibernatejdbcurl

With DB2 JDBC type 4 driver (com.ibm.db2.jcc.DB2Driver), the URL to use in the configuration to connect to a DB2 database is: jdbc:db2://HOST:PORT/DATABASE:currentSchema=SCHEMA; this is working perfectly fine with mainframes database.

But what is the URL to connect to a database on AS400 using the driver 'com.ibm.as400.access.AS400JDBCDriver'… 'currentSchema' included in the URL, is not working in this case. The username is being considered as the name of the schema. How do I set current schema using URL?

Best Answer

Use the as400 sub-protocol, and specify your default like this

jdbc:as400://hostname/default-schema 

http://www-01.ibm.com/support/docview.wss?uid=swg21398042