When you use vgLib.connectionService() to create a new connection, specify the isolation level by setting the vgVar.sqlIsolationLevel system variable. If you are running in VisualAge® Generator compatibility mode and vgVar.sqlIsolationLevel is 0, the new connection has an isolation level of repeatableRead. Otherwise the new connection uses serializableTransaction. For more information, see the sqlLib connect() function.
vgLib.connectionService() is for use only in programs migrated from VisualAge Generator and EGL 5.0. The function is supported (at development time) if the EGL preference VisualAge Generator compatibility is selected or (at generation time) if the VAGCompatibility build descriptor option is set to YES.
vgLib.connectionService() does not return a value.
vgLib.connectionService(
userID CHAR(8) in,
password CHAR(8) in,
serverName CHAR(18) in
[, product CHAR(8) inOut,
release CHAR(8) inOut
[, connectionOption STRING in
]])
This password is encrypted automatically if you pass a string literal to the function. For more information, see "Encrypting your passwords" in the EGL Programmer's Guide. Also see the "Compatibility" section in this topic.
In relation to a Java™ program, RESET reconnects to the default database; however, if the default database is not available, the connection status remains unchanged.
For more information about the default database, refer to the EGL Generation Guide.
To determine the string received when your code connects to a particular database, review the product documentation for the database or driver; or run your code in a test environment and write the received value to a file.
To determine the string received when your code connects to a particular database, review the product documentation for the database or driver; or run your code in a test environment and write the received value to a file.
The following values are tolerated for compatibility with VisualAge Generator, but are equivalent to D1E: R, D2A, D2C, D2E.
The following example shows how to use the vgLib.connectionService() function:
vgLib.connectionService(myUserid, myPassword,
myServerName, myProduct, myRelease, "D1E");
| Platform | Issue |
|---|---|
| Java generation | The Tomcat J2EE server ignores the userID and password from the vgLib.connectionService() function and uses the values from its server configuration. |