Results 1 to 4 of 4
Thread: SQLServer 2000 EXCEPTION
- 06-14-2007, 02:12 PM #1
Senior Member
- Join Date
- Jun 2007
- Posts
- 164
- Rep Power
- 6
SQLServer 2000 EXCEPTION
I have a method to close the connection in SQLServer2000 with java, but it returns to me an exception.
The problem is when I close the connection
here is the code:
and this is the exceptionJava Code:private Connection cn; private Statement st; private ResultSet rs; ..... ... protected int closeT(){ v=1; try { if(rs!=null)rs.close(); cn.close();st.close();} catch (Exception e){ System.out.println(" 'Database' method: 'CloseT' message: " + e.getMessage()); v=0; } return v; }
'DataBase' method: 'CloseT' message: [Microsoft][ODBC SQL Server Driver]Not valid State of transaction
thanks
- 06-29-2007, 03:05 PM #2
Senior Member
- Join Date
- Jun 2007
- Posts
- 132
- Rep Power
- 0
Close first the statement before the connection
;)
- 06-29-2007, 03:09 PM #3
Senior Member
- Join Date
- Jun 2007
- Posts
- 164
- Rep Power
- 6
I did that but it didn't work
any idea?
- 06-29-2007, 03:10 PM #4
Senior Member
- Join Date
- Jun 2007
- Posts
- 130
- Rep Power
- 0
Similar Threads
-
Where does the exception go?
By aytidaalkuhs in forum New To JavaReplies: 3Last Post: 04-07-2008, 02:24 PM -
Trouble with factory method - unhandled exception type Exception
By desmond5 in forum New To JavaReplies: 1Last Post: 03-08-2008, 06:41 PM -
Help, conect a JSP, SQL SERVER 2000
By Marcus in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-06-2007, 03:04 PM -
Tomcat with SQLSERVER 2005
By bbq in forum JDBCReplies: 1Last Post: 07-05-2007, 04:40 AM -
Error with Sql 2000:java.net.NoRouteToHostException: No route to host: connect
By bbq in forum JDBCReplies: 0Last Post: 06-27-2007, 07:48 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks