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,
" ", I just tried by using "import*;" 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


but anyHoww when I want to compile it using net beans it shows class not found
(as400JDBCDRIVER.class) and if I import the*; 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
The code I use is :

try {
                     conn = DriverManager.getConnection("jdbc:as400://" + system, username, password);
             DatabaseMetaData dbMetaData = conn.getMetaData();

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


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.
Tommy BraasCommented:
Oops...answered too fast.

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


Tommy BraasCommented:
Instead of             DriverManager.registerDriver(new;
Get expert help—faster!

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

Try writing AS400JDBCDriver as as400JDBCDriver
Please post the output of

jar tf your.jar

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

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 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
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.
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
Tommy BraasCommented:
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

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.