File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes These errors are driving me crazy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "These errors are driving me crazy" Watch "These errors are driving me crazy" New topic

These errors are driving me crazy

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
Been at this for months and I cant understand why this is happening. I have tried several drivers and I keep getting strange errors and I was hoping someone could help me out. I am trying to develop a applet-servlet-sql connection. I have placed all the classes in a Domino 4.6.7 server the code im using works in Tomcat. I have placed streams throughout the program to catch errors. So when i do the following in the init()
myCon = DriverManager.getConnection
no errors are thrown. But when I do the following
further in the program in the performTask()
PreparedStatement statement = myCon.prepareStatement(
"INSERT INTO login ([First_Name]) VALUES (?)");
at t.ServeTwoServlet.performTask(
at t.ServeTwoServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at COM.lotus.go.internal.InternalServletInvoker.executeServlet(
at COM.lotus.go.internal.InternalServletInvoker.service(
at COM.lotus.go.internal.ServletManager.service(
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

at the point where the code is throwing the error, the connection must have been reset to null(or never set at all). Don't have the rest of your code, so it's hard to help you with that kind of error( if it's not too long, post it ).
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Hey John where is the myCon object declared. Is it in that method, or outside where the performTask method has visibility of that object.
The reason we say this is because it is easy to see that at that last line the myCon variable is set to null.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: These errors are driving me crazy
It's not a secret anymore!