[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"?>


  <local-tx-datasource>
    <jndi-name>hhsDB</jndi-name>
    <connection-url>jdbc:oracle:thin:@aadv1db.abcd.com:1521:aadv1</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>sim</user-name>
    sim
	<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      
         <type-mapping>Oracle10g</type-mapping>
      
  </local-tx-datasource>


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