1 posts in topic
Flat View  Flat View

Posted By:   Allis_kuo
Posted On:   Thursday, October 18, 2001 09:53 AM

Connection con;


... con = DriverManager.get...


Statement st = con...

Here I got a nullPointerExeception. Is that wrong? How can I use con in the other methods?

Re: nullPointerExeception-connection

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, October 18, 2001 10:57 AM

pass it in or get the connection from the method which needs it. so make a method that is used to get the connection to the database. then call it from each method that needs a connection.
About | Sitemap | Contact