sql default schema

Hello,

when using embedded SQL in JVM-Cobol I do have the problem that most of the existing Cobolsources (> 8000) do not have the "FullQualified"  Tablename in the FROM Clause of their SQL-Statements.

With "native" Cobol it takes the username as the default Schema Qualifier. And if this is not sufficent it is possible to set QUALIFIER (as an SQL-Compiler Option).

This is not working with managed Cobol anymore. 

I do want to avoid the need to change all SQL-Statements to fully qualify the tablename. 

Does anybody have the same problem and if yes .... maybe a solution ?

Kind regards

Michael

Parents
  • Verified Answer

    The Schema specified in the Datasource URL is case sensitiv doing

    public void setUp() throws Exception {
    Class.forName("com.ibm.db2.jcc.DB2Driver");
    connection = DriverManager.getConnection(
    "jdbc:db2://dbserver:50003/vvst1:currentSchema=TEST;", "user",
    "passwordt");
    }

    does the job. This is also valid for the JBOSS-Datasource. 

    <?xml version="1.0" encoding="UTF-8"?>
    <datasources xmlns="www.jboss.org/.../schema">

    <datasource jta="false" jndi-name="java:jboss/jdbc/DB2LV1871_TYPE4"
    pool-name="java:jboss/jdbc/DB2LV1871_TYPE4" enabled="true" use-java-context="true" use-ccm="false">

    <connection-url>jdbc:db2://ryker.muc.lv1871.de:50003/vvsk1</connection-url>


    <connection-property name="currentSchema">TEST</connection-property>
    <connection-property name="dateFormat">3</connection-property>
    <driver>com.ibm.db2.jcc</driver>
    <security>
    <user-name>test</user-name>
    <password>tset</password>
    </security>

    </datasource>

    </datasources>

    Does the job. Note "TEST" instead of "test". Thanks to Kim Hoskin from MF for helping me on that issue.

    Michael

Reply
  • Verified Answer

    The Schema specified in the Datasource URL is case sensitiv doing

    public void setUp() throws Exception {
    Class.forName("com.ibm.db2.jcc.DB2Driver");
    connection = DriverManager.getConnection(
    "jdbc:db2://dbserver:50003/vvst1:currentSchema=TEST;", "user",
    "passwordt");
    }

    does the job. This is also valid for the JBOSS-Datasource. 

    <?xml version="1.0" encoding="UTF-8"?>
    <datasources xmlns="www.jboss.org/.../schema">

    <datasource jta="false" jndi-name="java:jboss/jdbc/DB2LV1871_TYPE4"
    pool-name="java:jboss/jdbc/DB2LV1871_TYPE4" enabled="true" use-java-context="true" use-ccm="false">

    <connection-url>jdbc:db2://ryker.muc.lv1871.de:50003/vvsk1</connection-url>


    <connection-property name="currentSchema">TEST</connection-property>
    <connection-property name="dateFormat">3</connection-property>
    <driver>com.ibm.db2.jcc</driver>
    <security>
    <user-name>test</user-name>
    <password>tset</password>
    </security>

    </datasource>

    </datasources>

    Does the job. Note "TEST" instead of "test". Thanks to Kim Hoskin from MF for helping me on that issue.

    Michael

Children
No Data