wood burning stoves 2.0*
The moose likes JDBC and the fly likes IBM toolbox for JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "IBM toolbox for JAVA" Watch "IBM toolbox for JAVA" New topic
Author

IBM toolbox for JAVA

Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
Hi All,
I am new to this JDBC stuff and IBM toolbox for Java.
I want to access files sitting on the server (AS/400) from my workstation.
I do see that the toolbox is installed on AS/400.
Now if I want to run a simple java program which will read a file on AS/400
how will I do that ? I want to use JDBC in this case.
Please guide me through or let me know the possible links where I can get step by step instruction for the same.
Thanks much

--Sulbha
Mala Sharma
Ranch Hand

Joined: Oct 29, 2004
Posts: 76
Hi Sulbha,

If you haven't, download IBM toolkit(google for it) that contains the driver and necessary classes to connect to AS400. then you 'll need to import:

that contains the driver classes so, in your connection just register the driver by:

This will give you JDBC connection to AS400. Hope that helps.

Mala
Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
If the toolbox is installed on the AS/400 then can I use the classes defined in the toolbox without needing to install the toolbox on the client machine (my workstation)?

Thanks again
Mala Sharma
Ranch Hand

Joined: Oct 29, 2004
Posts: 76
If you're going to run in on your client machine, then yes it should be there. In a nutshell, it should be in a classpath where you want to compile and deploy it. Maybe, someone else can clarify if my understanding is right.

Mala
Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
Cant I set set the classpath to point to the toolbox on AS/400?
That ways I need not always install the toolbox on the client.
Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
ok for now I have installed the toolbox on my workstation.

I am getting the following error


Code snippet:

I have set the classpath to point to the correct destination for my jt400.jar on my workstation.
I am going nuts resolving this.
Please help me !

Thanks

[ October 15, 2005: Message edited by: Sulbha Jan ]
[ October 15, 2005: Message edited by: Sulbha Jan ]
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
You need to make sure the file jt400.jar is in your classpath. This file contains jdbc driver for as400/db2.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
Thanks for the reply.

Following steps are taken before i compile my java pgm

path = c:\program files\java\jdk1.5.0\bin - This is done to access java classes.

set classpath = .;c:\folder1\folder2\jt400.jar

Now when i compile the program it gives me the following error.
package com.ibm.as400.access does not exist.

What am I missing here ?
Thanks
Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
Hello,
I could at least compile and run my java application but eachtime i have to specify the classpath for jt400.jar file explicitly (while compiling and running) on my DOS prompt.
Can anybody please please explain why my set classpath command doesn't work?
After running the above command when i type echo %CLASSPATH% it gives me the same text i.e
%CLASSPATH%.
I have tried all sorts of methods I can think of like-
I also created a user defined environment variable on my workstation with the path for jt400.jar file but of no avail.
I am totally confused now why doesnt this work.
Please can anyone solve my doubt. My last post was inactive for quite a while.
Please let me know where am i going wrong?

Thanks

[ October 25, 2005: Message edited by: Sulbha Jan ]
[ October 25, 2005: Message edited by: Sulbha Jan ]
Sulbha Jan
Ranch Hand

Joined: Jan 02, 2005
Posts: 37
Hello All,
Although the heading of this thread is :IBM toolbox for java, but the doubt in my prev post is not related to it, at all.
Mr Moderator: Is this post in an incorrect forum? or is my doubt too basic to be considered answerable by anyone?
Please let me know where am i going wrong? I am desperately waiting for anyone to show the correct way of doing it.
Help is greatly appreciated.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

Originally posted by Sulbha Jan:
Hello All,
Although the heading of this thread is :IBM toolbox for java, but the doubt in my prev post is not related to it, at all.
Mr Moderator: Is this post in an incorrect forum? or is my doubt too basic to be considered answerable by anyone?
Please let me know where am i going wrong? I am desperately waiting for anyone to show the correct way of doing it.
Help is greatly appreciated.


Sulbha,
The beginning of the post was about the IBM toolbox, so it is a good subject. The previous post (about classpaths) is really an offshoot. Sometimes questions evolve

While the post isn't in the wrong forum, it would be better answered in Java In General (Beginner.) Those folks have more practice with DOS. I recommend reposting just the classpath question there.

No question is too basic for JavaRanch. At first glance your configuration looks right to me. It's been a while since I've used DOS though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IBM toolbox for JAVA
 
Similar Threads
Creating an AS400-Object
JDBC for AS/400
graceful way to avoid hardcoding as400 library name in query.
Works with JDBC/ODBC but not Direct JDBC
Java and AS400