Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection

Status
Not open for further replies.

trungx

Programmer
Sep 20, 2001
28
VN
I write JSP , I have write a file connection , it has to use anny other pages. but I have to error:

java.sql.Connection conn = null;
java.sql.Connection getDBQuestCon()
{
try
{
if(conn == null || conn.isClosed())
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc:eek:dbc:quest2001" , "quest2001" , "quest2001");
}
}
catch(Exception e)
{
System.out.println(e);
}
return conn;
}
Connect to JDBC(in SQL-SERVER)
I don't know when I get if(conn == null || conn.isClosed())
have to error:

java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
java.lang.NullPointerException

please help me.

Trungx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top