Webservice with JDBC

Below code works fine when I run this as a stand alone appli cation.
However, when I expose this as a operation in a webervice, it throws below error  java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

I am trying this with the apache, I have exposed this as a webservce.
Any suggestions for this. I tried even DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver())
it does not work even for this. Both of them are working fine when I run them as stand alone on Eclipse, when I espose it as websevice it does not work.

Any suggestions/
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.

Gurvinder Pal SinghCommented:
if you are using tomcat or jboss, you need to add the oracle jar files (ojdbc.jar) in the lib folder of server

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
Do you have path to classes12.jar included in your CLASSPATH? It's something like that:
NaveenBandaruAuthor Commented:
Got resolved
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.