skip to main content
IP API Reference for Java : Connection-level Methods for Java : sqlipConnect
 

sqlipConnect

This connection-level method connects to the specified database using the specified user name and password. In multi-threaded mode, each connection is on a new thread created by the server. This is the first method called on a new instance of the class you registered for the oajava.sql.sqlip interface (see oajava.sql.sqlip Interface for more information).
int sqlipConnect(
String psDataSourceName,
String psUid,
String psPwd,
String psDataSourceCurrentCatalog,
String psDataSourceIPProperties
String psDataSourceIPCustomProperties);
 
Table 68: Parameters for sqlipConnect 
Parameter
Type
Description
INPUT
 
 
psDataSourceName
String
Logical name of the database the user specified when connecting. For example, DEMO.
psUid
String
User ID
psPwd
String
Password
sDataSourceCurrentCatalog
String
Current catalog if specified by the client.
psDataSourceIPProperties
String
Value of the DataSourceIPProperties configured for this data source. The IP can use this attribute for its own purpose.
psDataSourceIPCustomProperties
String
Custom connect string portion as passed in by the client. This can be parsed to retrieve any custom connection level options.
RETURN
 
 
 
int
OADS_SUCCESS –connected
OADS_ERROR – error occurred during connection. A specific error is returned when sqlipError is called.
Important: If your Java layer uses JNDI, you must initialize the class loader on the thread created for this connection by placing the following code in your sqlipConnect method.
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
If the class loader is not initialized on the thread, only the first connection will work properly. Other connections will fail because they cannot load the required classes.

See also 

"DataSourceIPProperties" in the OpenAccess SDK Administrator’s Guide