Luis,

The native db2 driver isn't acually in jt400Native.jar but in the
db2_classes.jar. The driver name is different and so is the url syntax.
Use it like this, only replace s109dfda with your system name (not your
host name).

DriverManager.registerDriver(new com.ibm.db2.jdbc.app.DB2Driver());
dbConnection = DriverManager.getConnection("jdbc:db2:s109dfda");

If I remember correctly db2_classes.jar doesn't need added to your
classpath as it's in the java ext directory and available already.

If you're not doing anything else but jdbc in your program, then you
don't need to use the jt400 jars at all. If you are doing anything else
(like manipulating spooled files, calling programs, etc, then use the
jt400Native.jar).

Coy Krill
Systems Analyst
Whidbey Island Bank


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Luis Fernandes
Sent: Monday, November 19, 2007 08:31
To: Java Programming on and around the iSeries / AS400
Subject: Re: Connecto to AS/400 with java

Exactly, but this is my first time workin in as/400.

Can u please send a simple code that use this native driver to connect
to DB ( I dont know the syntaxe). Its necessary add something to
classpath ? how my class will use the native driver ? its necessary
import something to my class ?

And If i want to use the ToolBox for java ? I must add the jt400.jar
to wish diectory ?

Thanks in advance

On Nov 19, 2007 4:44 PM, Rick DuVall <R_C_DUVALL@xxxxxxxxxx> wrote:
Hello Luis,

If I understand your problem, what you need to use are the
classes in the jt400Native.jar. You will find this jar in
\QIBM\ProdData\OS400\jt400\lib\jt400Native.jar I believe. It
contains the classes to connect to the db from 'within' the 400.
HTH. Good luck.



--
Best regards,
Rick

Systems Manager
Dealer's Auto Auction of Okc
1028 S. Portland
Oklahoma City, OK 73108
(405) 947-2886
mailto:rick@xxxxxxxxxx
http://www.nothingisreal.com/dfki/no-word



Saturday, November 17, 2007, 2:37:30 PM, you wrote:

Hello,

But now i have a client , that ask me for a application that run in
OS/400 envoirenment. My question is : How can i connect to the DB2
in as/400 when the app run inside the As/400. We have to use The
ToolBox for java ? or we have other/better options (Native Drivers)?

Best regards in advance


--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
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 ...

Replies:

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

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