David,

Thanks for the response.  I am connecting to the AS400 using JNDI to look up
a datasource in Websphere.

        Hashtable parms = new Hashtable();
        parms.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");

        // Access Naming System

        Context ctx = new InitialContext(parms);


//**************************************************************************
******************************
        //  use naming service to lookup data source object.
        //  select datasource based on initial parameter

//**************************************************************************
******************************
        datasource = (DataSource) ctx.lookup(contextDatasource);

Then I create a connection using the follwoing:

        connection = datasource.getConnection(uid, password);

Do I cast this connection as a AS400JDBCConnection or can I do a getSystem()
on this connection?

-----Original Message-----
From: David Gibbs [mailto:dgibbs@mks.com]
Sent: Friday, June 28, 2002 11:43 AM
To: java400-l@midrange.com
Subject: Re: JDBC Connections and non File IO operations


(Repost due to bad formatting of original message)

"Gibson.Stephen" <Gibson.Stephen@burlington.com> wrote in message
7DC1785A8928D611A9BB00B0D0AB7D824F77C0@biwgdcmsg02.burlington-ind.com">news:7DC1785A8928D611A9BB00B0D0AB7D824F77C0@biwgdcmsg02.burlington-ind.com..
> If I have a JDBC Connection open that I am using for file access, can I
use
> that same connection to perform dataArea manipulation and/or command
calls?


Not directly ... but you if you declare the JDBC connection an
AS400JDBCConnection, you can retrieve an AS400 object from it (using
getSystem()) ... you can then use that object to perform data area
manipulations and command calls.

david


--
David Gibbs
Sr. Software Engineer / R&D / MKS Inc., www.mks.com
Lombard, IL, USA; tel: 630-495-2108; fax: 630-495-3591
Build Better Software





_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.