Yes, include the userid and password in the connection.

Example: Connecting to the server database and specifying user ID and
password

                       // Connect using properties on the
                       // URL and specifying a user ID and
                       // password
     Connection c = DriverManager.getConnection(
                        "jdbc:as400://mySystem;naming=sql;errors=full",
                        "auser",
                        "apassword");

Be sure and CLOSE all your connections when finished using each one.

Kristen

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Ewout N Boter
Sent: Wednesday, January 17, 2007 6:59 AM
To: java400-l@xxxxxxxxxxxx
Subject: Defining an AS400 connection

In our shop, we are doing some experiments with Java. We access the 
iSeries database with JDBC. When our pilot application is started, a 
JDBC-connection is established with the statement "connection = 
DriverManager.getConnection("jdbc:as400://systemname")". A pop-up window 
is displayed, allowing the user to log on. So far, so good. Now, in the 
application, we have to call an RPG service program. We plan to use the 
class ServiceProgramCall from the AS/400 Toolbox for Java. The methods of 
this class require an instantiation of the class AS400. Of course, we 
don't want the user to have to log on two times, once for creating the 
JDBC-connection, and once for creating the AS400-connection. Is it 
possible to create the AS400-connection 'in the background', making use of 
the fact that a JDBC-connection has already been established?

Ewout

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2022 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.