package does not exists?

Hi , experts I downloaded some jarfiles for accessing as400 db2 database
and wheather  I run it as a jsp or when I edit it using NetBeans  as a servlet class it appears package does not exists,
"com.ibm.as400.access ", I just tried by using "import com.ibm.as400.access.*;" with same bad  results
With the   Net beans Ide I added the jar files as Libraries and when I check them out (the jt400 from inside) it shows up the full path completed

jt400.jar:
com
      ibm
            as400
                     access
                                as400JDBCDRIVER.class


but anyHoww when I want to compile it using net beans it shows class not found
(as400JDBCDRIVER.class) and if I import the com.ibm.as400.access.*; I get this error "package does not exists"

I downloaded the  jars and I put them in a folder I just called IBMJTOPEN(just a name) where I unzipped them at
I added the jars path to my class path
--------------------------------------------------------------------------------
%classpath%;C:\WINNT\java\Packages;C:\jakarta-tomcat-5.0.28\common\lib\servlet-api;C:\jakarta-tomcat-5.0.28\common\lib\jsp-api;C:\IBMJTOPEN\lib\jt400.jar;C:\IBMJTOPEN\lib\util400.jar;C:\IBMJTOPEN\lib\jt400Servlet.jar;C:\IBMJTOPEN\lib\util400.jar;C:\IBMJTOPEN\lib\jt400Servlet.jar;C:\IBMJTOPEN\lib\composer.jar;C:\IBMJTOPEN\lib\jt400micro.jar;C:\IBMJTOPEN\lib\jt400Proxy.jar;C:\IBMJTOPEN\lib\jt400Servlet.jar;C:\IBMJTOPEN\lib\jui400.jar;C:\IBMJTOPEN\lib\outputwriters.jar;C:\IBMJTOPEN\lib\reportwriter.jar;C:\IBMJTOPEN\lib\tes.jar;C:\IBMJTOPEN\lib\uitools.jar;
---------------------------------------------------------------------------
The code I use is :


try {
            DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
                     conn = DriverManager.getConnection("jdbc:as400://" + system, username, password);
             DatabaseMetaData dbMetaData = conn.getMetaData();
             conn.close();

           
            }
            catch (SQLException e){System.out.println(e.getMessage());e.printStackTrace () ;}
            catch (ClassNotFoundException e){System.out.println(e.getMessage());e.printStackTrace () ;}
     
     return conn;

---------------------------------------------------------------------------------------------

Help!!!!
edwbear1976aAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tommy BraasCommented:
You need to ensure that the jar file is on both the build classpath AND the classpath for when you execute your code.
0
Tommy BraasCommented:
Oops...answered too fast.

You should NEVER reference a driver directly in your code. Use the following code instead:

Class.classForName("com.ibm.as400.access.AS400JDBCDriver");

0
Tommy BraasCommented:
Instead of             DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

mrigankCommented:
Try writing AS400JDBCDriver as as400JDBCDriver
0
CEHJCommented:
Please post the output of

jar tf your.jar

(making obvious adjustments to the name of the jar file)
0
objectsCommented:
try adding the jars to your jre ext directory instead of adding them to your classpath
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mayank SAssociate Director - Product EngineeringCommented:
Many IBM classes actually had 'IBM' in capital case in their names. Try with com.IBM instead of com.ibm. Also, you should keep the driver class-name in a properties-file or a configuration-file and read from it, instead of hard-coding it in the code
0
Giant2Commented:
Try to use your Netbeans/Eclipse/Jbuilder and type the full class name.
The GUI help you suggesting the correct name (capital/lower letter and so on). Be sure you have the jar file in the classpath.
In this manner you are sure not make a mistake in the classpath/classname.

Hope this could help you.
Bye, Giant.
0
edwbear1976aAuthor Commented:
well, thank you all for your advices, the problem is solved, I changed the reference  to the driver as orangehead911 said and I also  put the jar file in the  jre ext directory as object adivised me , I'm going the increase the points to split
thank you all buds
0
CEHJCommented:
:-)
0
Tommy BraasCommented:
;-D
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.