AS/400 JDBC Data Source: naming property ("sql" vs. "system") - Websphere

This is a discussion on AS/400 JDBC Data Source: naming property ("sql" vs. "system") - Websphere ; Here is the problem I'm facing: If one wishes to override the library list associated with the user attempting to connect to the database by way of a JDBC data source, then the naming property has to have the value ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: AS/400 JDBC Data Source: naming property ("sql" vs. "system")

  1. AS/400 JDBC Data Source: naming property ("sql" vs. "system")

    Here is the problem I'm facing:

    If one wishes to override the library list associated with the user
    attempting to connect to the database by way of a JDBC data source,
    then the naming property has to have the value "system".

    If one wishes to use entity beans for persistence purposes, then the
    naming property has to have the value "sql". ("system" won't work
    because the SQL statements automatically produced by WSAD contain
    qualified table names of the form SCHEMANAME.TABLENAME - the emphasis
    goes to the dot versus a slash).

    Is there any way for me to manage to do both? I.e. both use my own
    preferred library list and use entity beans for persistence purposes?Is
    there some particular property value combination or programmatic trick
    that would allow me to do so?

    Many thanks in advance!
    Panagiotis Varlagas


  2. Re: AS/400 JDBC Data Source: naming property ("sql" vs. "system")

    I think you are out of luck as far as changing the library list and
    using SQL naming goes. You might be able to get round this by using
    Independent ASPs and the databaseName property to play around with the
    libraries, but I have never looked into this (would anyone who has
    dealt with IASPs like to comment?)...

    Are your SQL statements generated only at runtime? Or are they
    generated by a WSAD Wizard before you deploy your EAR file? If you have
    wizard-created source, can you alter it after the wizard has run
    (changing all the dots to slashes), before deploying your EAR file?


  3. Re: AS/400 JDBC Data Source: naming property ("sql" vs. "system")

    On a second thought it seems that it doesn't even matter. Say one has
    three tables ("files") T1, T2, T3 in three schemata ("libraries"), say,
    S1, S2, and S3 respectively. Since three entity EJBs are to be
    generated at development time by way of WSAD wizardry, the library list
    associated with the profile of the user used for DB connection (i.e. as
    the alias associated with the data source) is immaterial. The only
    thing needed at deployment time is bulk replacing the schema names,
    if they happen to be different in the production environment than in
    the staging one (e.g. S1PROD vs. S1TEST).

    On another note, there is also the (orthogonal) issue of making program
    calls to the backend iSeries machine. This of course has nothing to do
    with the "naming" and "libraries" properties of the data source;
    however, a library list still has to be built in order for the
    libraries where the
    programs to be called lie to become available to the system user
    signing on (programatically) to the backend iSeries. This can easily be
    done programatically, for instance by the following code snippet:

    AS400 as400 = new AS400(systemName, userid, password);
    CommandCall cmd = new CommandCall(as400);
    for (Iterator it =
    Environment.getLiblList().elements();it.hasNext() {
    String libName = ((String) it.next()).trim();
    cmd.run("ADDLIBLE LIB(" + libName + ")");
    }

    Seems I had these two orthogonal issues mixed up in my mind. Whenever
    one does bottom-up EJB/RDB mapping, the library (schema) comes into
    play at that very moment.

    Thanks for the help!

    Panagiotis.


+ Reply to Thread