EXEC SQL
EXEC SQL
1. Database-Name, User-Name, Password , DBString, Connection-Name and UsrPwd are Nonnumeric Literals, as defined in the Definitions section of the Preface of this document or Host Variables.
2. Connection-Name can be referenced by the SET CONNECTION statement
2. When the TO phrase is omitted, or DEFAULT is specified, no database name is passed to the jdbc driver. If USER and USING are omitted too, then no parameter is passed to the jdbc driver, assuming that all the necessary information is provided by the iscobol.jdbc.url configuration property.
3. When the AS phrase is omitted, the connection name is the same as the database name.
4. Once connected you can retrieve the connection handle by invoking the getCurrConnection() method of the com.iscobol.rts.EsqlRuntime object. This method returns a java.sql.Connection that can be passed to other java programs.
5. UsrPwd contains both UserName and Password separated by "/". Example: UsrPWD = "scott/tiger".
7. If the iscobol.jdbc.datasource configuration property specifies a valid class, then the connect() method of that class is invoked to gain connection. If the property is not set, then the runtime invokes the Java SQL DriverManager to gain connection. The following snippet shows a prototype of a valid class
import java.sql.*;import javax.sql.*;Note - The parameters dsn, user and passwd are the ones used in the CONNECT statement. If the program performs just CONNECT because database name and login credentials were put in the JDBC URL, then the class does not receive any parameter.
exec sqlconnect to :dbname
| Copyright (c) 2017 Veryant |
| Contact us |
|
Please share your comments on this manual or on any Veryant product documentation with the email button at the top left |