| | |
Error is [Microsoft][ODBC SQL Server Driver]Connection is busy
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2006
Posts: 20
Reputation:
Solved Threads: 0
Hi,
I hava 1 error in accessing database using javabean in jsp(jsp custom actions).The error like this
javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
my source code is given below.Anybody help me??
package SQLBean;
import java.sql.*;
import java.io.*;
public class DbBean implements java.io.Serializable{
private String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
private Connection dbCon;
public DbBean(){
super();
}
public boolean connect() throws ClassNotFoundException,SQLException{
Class.forName(dbDriver);
dbCon = DriverManager.getConnection("jdbc dbc:mybean","","");
return true;
}
public void close() throws SQLException{
dbCon.close();
}
public ResultSet execSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
ResultSet r = s.executeQuery(sql);
return (r == null) ? null : r;
}
public int updateSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
int r = s.executeUpdate(sql);
return (r == 0) ? 0 : r;
}
}
<HTML>
<HEAD><TITLE>DataBase Search</TITLE></HEAD>
<BODY>
<%@ page language="Java" import="java.sql.*" %>
<%@ page import="SQLBean.*"%>
<jsp:useBean id="db" scope="application" class="SQLBean.DbBean" />
<jsp:setProperty name="db" property="*" />
<center>
<h2> Results from </h2>
<hr>
<br><br>
<table>
<%
db.connect();
ResultSet rs = db.execSQL("select * from employ");
int i = db.updateSQL("UPDATE employ set fname = 'raji' where empno='000010'");
out.println(i);
while(rs.next()) {
%>
<%= rs.getString("empno") %>
<BR>
<%
}
%>
<BR>
<%
db.close();
%>
Done
</table>
</body>
</HTML>
Anyone help me??
Thanx in advance....
I hava 1 error in accessing database using javabean in jsp(jsp custom actions).The error like this
javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
my source code is given below.Anybody help me??
package SQLBean;
import java.sql.*;
import java.io.*;
public class DbBean implements java.io.Serializable{
private String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
private Connection dbCon;
public DbBean(){
super();
}
public boolean connect() throws ClassNotFoundException,SQLException{
Class.forName(dbDriver);
dbCon = DriverManager.getConnection("jdbc dbc:mybean","","");
return true;
}
public void close() throws SQLException{
dbCon.close();
}
public ResultSet execSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
ResultSet r = s.executeQuery(sql);
return (r == null) ? null : r;
}
public int updateSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
int r = s.executeUpdate(sql);
return (r == 0) ? 0 : r;
}
}
<HTML>
<HEAD><TITLE>DataBase Search</TITLE></HEAD>
<BODY>
<%@ page language="Java" import="java.sql.*" %>
<%@ page import="SQLBean.*"%>
<jsp:useBean id="db" scope="application" class="SQLBean.DbBean" />
<jsp:setProperty name="db" property="*" />
<center>
<h2> Results from </h2>
<hr>
<br><br>
<table>
<%
db.connect();
ResultSet rs = db.execSQL("select * from employ");
int i = db.updateSQL("UPDATE employ set fname = 'raji' where empno='000010'");
out.println(i);
while(rs.next()) {
%>
<%= rs.getString("empno") %>
<BR>
<%
}
%>
<BR>
<%
db.close();
%>
Done
</table>
</body>
</HTML>
Anyone help me??
Thanx in advance....
![]() |
Similar Threads
- Error in creating ODBC connection."Reason: Not assosiated with a trusted SQL Server" (ASP)
- SQL DB Connection Problems (MS SQL)
- Connecting to SQL server in Local machine (ASP)
- MS SQL Server 2000 - Strings???!? (MS SQL)
- question about connecting odbc to sql through php script (PHP)
- SQL server error: 18452 - connection to SQL error (Windows NT / 2000 / XP)
Other Threads in the JSP Forum
- Previous Thread: error due to accessing database connection using jsp
- Next Thread: jar files (urgent)
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write





