[jboss-user] [JBossWS] - java.sql.SQLException: Already closed

peiguo do-not-reply at jboss.com
Wed Sep 6 11:29:19 EDT 2006

In my web service, I need to access Oracle database, so I created the oracle-ds.xml file in my deploy directory like this:
<?xml version="1.0" encoding="UTF-8"?>


And in my code I have this function to get connection for me:
	private Connection getConnection() throws Exception {

		InitialContext initialContext = new InitialContext();
        javax.sql.DataSource ds = (javax.sql.DataSource) initialContext.lookup("java:hhsDB");
        java.sql.Connection conn = ds.getConnection();
		return conn;

But it keeps giving me "java.sql.SQLException: Already closed", even after I removed those .close() calls from my code... What should I do?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969773#3969773

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969773

More information about the jboss-user mailing list