• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem using JDBC connection in NetBeans IDE

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all..
I have gone through FAQ's section. But I have not found any answer for my problem, so I am posting it here.
I am able to connect to the Oracle database using a "hello world" kind of program(like able to retrieve the data from a table in the database). But the problem is when I am trying to develop a small login application using JSP and Servlets, I am unable to connect. I am doing this application through Sun NetBeans 5.5 IDE. I have included the .jar(ojdbc14.jar) file in the libraries of my project. But still I am unable to connect to the database.
I have put that "connection" code in a try-catch block and the code I have written in catch block is getting executed.
How do I resolve my problem?
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a stacktrace or other information you have on the exception which is being thrown?
 
Nikhil Reddy Lingala
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I didn't include any code to print the stack trace..
I have just written a println statement that prints "error in this connection.java"


try{
//code for connecting database, which worked when tried with a simple
//program without using IDE
}catch(Exception e){
System.out.prinln("excetion in connection.java");
}

 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

then MAKE it print the stacktrace.

If you print the same message for all exceptions, it won't give you any usefull information.

Herman
 
Nikhil Reddy Lingala
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes... I have given

e.printStackTrace();

to provide me the info wanted.. I was able to debug....
the problem was with the URL in the getConnection() method...!!!
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you imported classes12.jar file.
I too had same kind of problems.when I imported that jar my problem solved.
tell me which exception you got.
 
sruthi das
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you imported classes12.jar file.
I too had same kind of problems.when I imported that jar my problem solved.
tell me which exception you got.
 
reply
    Bookmark Topic Watch Topic
  • New Topic