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
  • Hello,

    I have checked your proposal. The database is now specified as a JBOSS Datasource like this :

    <?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:currentSchema=test;</connection-url>

            <!-- this must me commented out. Otherwiese youl receive "Property cannot be overwritten by url" (Which is plausible)

            <connection-property name="currentSchema">test</connection-property>

            It is not working with this setting either -->


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

        </datasource>

    </datasources>

    Even with the Schema as a Property in the URL the SQL-Statements in Cobol are returning "-204" (Table or view does not exist).

    I do have to hardcode in Cobol :

    select bla

    from test.myfinetable;

    using just

    select bla

    from myfinetable;

    Results in error code "-204"

    Kind regards

    Michael

Reply
  • Hello,

    I have checked your proposal. The database is now specified as a JBOSS Datasource like this :

    <?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:currentSchema=test;</connection-url>

            <!-- this must me commented out. Otherwiese youl receive "Property cannot be overwritten by url" (Which is plausible)

            <connection-property name="currentSchema">test</connection-property>

            It is not working with this setting either -->


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

        </datasource>

    </datasources>

    Even with the Schema as a Property in the URL the SQL-Statements in Cobol are returning "-204" (Table or view does not exist).

    I do have to hardcode in Cobol :

    select bla

    from test.myfinetable;

    using just

    select bla

    from myfinetable;

    Results in error code "-204"

    Kind regards

    Michael

Children
No Data