Statement Closed Error

Hi Friends,
I have two queries to run from one class.I send the queries to another class,which send me back the resultset to cook.For one query its running fine,but i don't know why for two queries ,its throwing error as "statement closed".Can you please tell me where i am going wrong???
In first method i have:
ResSet qt = new ResSet();
ResultSet rs=qt.getResultSet(query);
2nd method:
ResSet qt1 = new ResSet();
ResultSet rs1=qt1.getResultSet(query1);
public class ResSet
  private Connection con;
  private Statement st;
  ResultSet results;
  private DataSource ds;
  int count = 0;
public void getResults()
    try{
      Context init = new InitialContext();
       if(init == null )
          throw new Exception("No Context");
       Context ctx = (Context) init.lookup("java:comp/env");
       ds = (DataSource) ctx.lookup("jdbc/con");
       con.close();
      }catch(Exception e){e.printStackTrace();}
public ResultSet getResultSet(String Query)throws Exception
   if (ds != null) {
     con = ds.getConnection();
     if (con != null) {
       st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                ResultSet.CONCUR_READ_ONLY);
   results = st.executeQuery(Query);
   return results;
public void close()
  try { results.close(); } catch (Exception ex) {}
  try { st.close(); } catch (Exception ex) {}
  try { con.close(); } catch (Exception ex) {}
}

No,I am calling close() after I display the results in my jsp,that's the end line of my project.I even tried commenting it,but that didn't worked either.Please help me..cause i have no clue where i am goin wrong.

Similar Messages

  • BUG: Business Components using Datasources on Websphere - statement closed

    Hi,
    This is an unusual combinatation, we are deploying business components projects on websphere with a SQL Server database. This was originally deployed all to Oracle. We have managed to convert the project sucessfully (JDeveloper 10.1.3) and on Websphere, however when we moved our application module configurations (bc4j.xcfg) to use JNDI data sources which works in Jdeveloper, we are encountering problems using websphere with business components and datasources.
    The statement closed error occurs when trying to calling executequery() method on the view object, not the first time the JSP page is accessed, but the second time. Refresh page all is good. Access page again error occurs. Very consistent.
    Our code will often do applicationmodule.findViewObject("name"), if not found then create it, otherwise use the vo and kapow bombs out on the executequery method if reusing the view object.
    ERROR
    DSRA9110E: Statement is closed.oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Statement: SELECT Groups.GROU_ID FROM GROUPS Groups WHERE (GROU_ID=1)
    at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java(Compiled Code))
    at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java(Compiled Code))
    at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java(Compiled Code))
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java(Compiled Code))
    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java(Inlined Compiled Code))
    at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java(Inlined Compiled Code))
    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java(Compiled Code))The datasource uses the connection pooling driver class com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource.
    Ampooling is on. It appears the jdbc prepared statement is being closed but bc4j is expecting to still be open?
    Any ideas on diagnosing the issue or app module config changes greatly appreciated.
    Mark

    Hi Steve,
    This is not a composition association. Actually, this is an association from a table to an intersection (many-to-many) table. The code in my service is based on the SRDemo, see SRServiceImpl#updateSkillsForCurrentStaff(List) and is called on a save button from a shuttle page.
    The current master is the master I want it to belong to. The link to the master gets correctly saved in the database (just as in the SRDemo). We can also navigate from the master view row to the find the detail view row using the generated RowIterator. However, this does not work from the master entity row to the detail entity row. The problem is really at the entity level.
    Thanx
    Olivier

  • SQLException: Closed Connection, SQL state [null]; error code [17002]

    Hello All,
    I am supporting a Java 5 project on Tomcat. We've used Spring and Stored Procedure in the project.
    Recently we deployed our application in a GoLive environment and have started seeing Timeout errors in log files. After around two days we also have to restart Tomcat as users are no more able to login to access the application.
    Same application runs fine without any timeout issues on another environment.
    The only difference between two environments is that the Go-Live env has a firewall between Tomcat and Database and the other environment hosts both Tomcat and Database on same machine (i.e. no firewall).
    For GoLive env the only port open on firewall for JDBC connection is 1521 and is used in the connection string url for obtaining the connections.
    When there is a Timeout error, the N/w admin guy observed that the JDBC connection was not attempted on 1521 port, but on some random port which is not open on firewall, due to which the Database server logs also do not show entry for this connection attempt as it gets blocked by the firewall.
    I am not sure why a randam port should be used to connect when a specific port is mentioned in the connection url? Also what can be making this port switching?
    Application uses Apache DBCP with Spring to obtain connections.
    Has anyone experienced similar errors?
    Any suggestions/help on this issue is greatly appreciated!
    Many Thanks,
    CD
    ===============================
    Error Log Extract:
    Error while extracting database product name - falling back to empty error codes
    org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Closed Connection
    java.sql.SQLException: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:1605)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.getMetaData(PoolingDataSource.java:231)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:172)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:207)
    at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:187)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:126)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:92)
    at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:96)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:294)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Could not close JDBC Connection
    java.sql.SQLException: Already closed.
    at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:77)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:286)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:247)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:297)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:615)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:284)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Application exception overridden by rollback exception
    org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT ID_USER_DETAILS, USERNAME, CREATED_ON, LAST_LOGIN FROM USER_DETAILS  WHERE STATUS = 157 AND SUPERUSER <> 'Y']; SQL state [null]; error code [17002] ; Io exception: Connection timed out; nested exception is java.sql.SQLException: Io exception: Connection timed out
    java.sql.SQLException: Io exception: Connection timed out
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:820)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
    at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:845)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1313)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:333)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:282)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Batch Job Failed: org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Closed Connection

    I am using latest Jrockit 16)5, ojdbc6_g.jar,spring.jar Weblogic 10.3 and Oracle 10G 10.2.4 .. whatever but always get "Closed Connection"
    java.lang.Throwable: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:750)
    at oracle.jdbc.OracleConnectionWrapper.createStatement(OracleConnectionWrapper.java:183)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

  • Error "No operations Allowed after statement closed"

    Hi,
    I have a little program that I want to grab a list of names out of MySQL (it does) and when I click on the name I want it to display some information about the person. This is where I run into the error, when I click on a name in the list box it gives me the error "No operations allowed after statement closeed". I'm not sure where my statement is being closed, in my listSelectionListerner I never close the statement so I'm not sure whats heppening. Heres the code:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.sql.*;
    import java.util.*;
    public class Gifts extends JFrame
         static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
         static final String DATABASE_URL = "jdbc:mysql://localhost/test?user=root&password=root";
       private JList nameList;
         private JTextArea statList;
         private JButton add;
       private Container container;
         private JPanel nameListPanel, statListPanel, buttonPanel;
         private Connection conn;
         private Statement stat;
       public Gifts()
              super( "Spiritual Gift Database" );
              try
                   Class.forName(JDBC_DRIVER);
                   conn = DriverManager.getConnection(DATABASE_URL);
                   stat = conn.createStatement();
                   ResultSet rs = stat.executeQuery("SELECT heading1 FROM demo");
                   Vector vector1 = new Vector();
                   while(rs.next()) vector1.add(rs.getObject(1));
                   container = getContentPane();
               container.setLayout( new FlowLayout() );
                   nameListPanel = new JPanel();
                   statListPanel = new JPanel();
                   buttonPanel = new JPanel();
               nameList = new JList(vector1);
               nameList.setVisibleRowCount( 9 );
                   nameList.setPrototypeCellValue("XXXXXXXXXXXX");
                   nameList.addListSelectionListener(
                        new ListSelectionListener()
                             public void valueChanged(ListSelectionEvent event)
                                  try
                                       ResultSet resultSet = stat.executeQuery("SELECT * FROM demo");
                                       StringBuffer results = new StringBuffer();
                                       ResultSetMetaData metaData = resultSet.getMetaData();
                                       int numberOfColumns = metaData.getColumnCount();
                                       for(int i = 1; i<=numberOfColumns; i++)
                                       results.append(metaData.getColumnName(i) + "\t");
                                       results.append("\n");
                                       while (resultSet.next())
                                            for(int i = 1; i<= numberOfColumns; i++)
                                            results.append(resultSet.getObject(i) + "\t");
                                            results.append("\n");
                                  catch(SQLException sqlException)
                                       JOptionPane.showMessageDialog(null,sqlException.getMessage(),
                                       "Database Error1", JOptionPane.ERROR_MESSAGE);
                                       System.exit(1);
                   statList = new JTextArea(10,20);
                   add = new JButton("Add Entry");
               nameList.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
                   statListPanel.add(new JScrollPane(statList));   
               nameListPanel.add( new JScrollPane(nameList));
                   buttonPanel.add(add);
                   container.add(nameListPanel, BorderLayout.EAST);
                   container.add(statListPanel, BorderLayout.WEST);
                   container.add(buttonPanel);
               setSize( 400, 300 );
               setVisible( true );
              }//end try block
              catch(SQLException sqlException)
                   JOptionPane.showMessageDialog(null,sqlException.getMessage(),
                   "Database Error1", JOptionPane.ERROR_MESSAGE);
                   System.exit(1);
              catch (ClassNotFoundException classNotFound)
                   JOptionPane.showMessageDialog(null, classNotFound.getMessage(),
                   "Driver Not Found", JOptionPane.ERROR_MESSAGE);
                   System.exit(1);
              finally
                   try
                        stat.close();
                        conn.close();
                   catch (SQLException sqlException)
                        JOptionPane.showMessageDialog(null,
                        sqlException.getMessage(), "Database Error2",
                        JOptionPane.ERROR_MESSAGE);
                        System.exit(1);
         }//end Gifts()
       public static void main( String args[] )
          Gifts application = new Gifts();
          application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }

    The fact is,
    the finally statement is reached after the whole object is initialized,
    that means that your statement is closed, before you make an action
    with you ListSelectionListener.
    Try working with a connect and disconnect method, or something like that,
    which are called during your valueChangeg() method!

  • HT202159 I have been on to apps store logged in and gone on my purchurse to try and re down load Mountin Lion however it just states an error as accord I can't get it to re down load to launch pad in lion

    I have been on to apps store logged in and gone on my purchurse to try and re down load Mountin Lion however it just states an error as accord I can't get it to re down load to launch pad in lion

    1. You did not get an error message telling you that your iPhoto library was getting full. You got a message telling you that your HD was getting full, right?
    OS X needs about 10 gigs of hard drive space for normal OS operations - things like virtual memory, temporary files and so on.
    Without this space your Mac will slow down as the OS hunts for space on the disk, files will be fragmented, also slowing things down, apps will crash and the risk of data corruption - that is damage to your files, photos, music - increases exponentially.
    Your first priority is to make more space on that HD. Nothing else can be done until you do.
    Purchase an external HD and move your Photos and Music to it. Both iPhoto and iTunes can run perfectly well with the Library on an external disk.
    Your Library has been damaged from being run on an overfull disk.
    How much free space on it now?

  • I finally got my iphone out of recovery mode, after 7.1.1 but now it won't accept my Icloud info and states "An error occrured while trying to save the Icloud account?" What do I do????

    I tried updating my iphone 4 to 7.1.1 and it went straight into recovery mode.... I finally got my iphone out of recovery mode, but now it won't accept my Icloud info and states "An error occrured while trying to save the Icloud account?" What do I do????

    Same situation. I installed iOS 8 beta 4 on my iPhone 5 and a few days later my iCloud account disappeared. My contacts and calendar entries are gone.
    My Mac Mini and MacBook do sync as they should with iCloud.
    When I try to log in to iCloud on the iPhone (the username shows "[email protected]" and password shows "required"), I put in my username and password and tap "Sign In", It says "Verifying" at the top and after a while checkmarks appear next to my username and password. Then I get an error message saying "An error occurred while trying to save the iCloud account". If I tap OK the message goes away, leaving my username and password intact (checkmarks are now gone). If I tap "Sign In" again I get a message saying " '[email protected]' is Already Added. This iCloud account has already been added to your iPhone". If I go back to Settings and then go into iCloud again it's not set up and appears as I stated at the beginning of this paragraph.
    Nothing works and the sync does not occur. Contacts are empty and Calendar has no entries.

  • Stream closed error while testing a composite in EM

    HI,
    I have deployed a simple composite and wanted to test it in EM. I am getting a stream closed popup, not sure whats wrong?
    I have restarted the server and problem still persists.

    its actually remote server, I am able to deploy a simple HelloWorld composite and even able to see the same in Em.I can even browse through all the composites deployed there by many other people.But problem is when I try to test it its giving the Stream closed error.
    Is it something to do with access permissions, if so i would not have deployed it in first case..
    the pop up error message----
    Stream Closed
    For more information, please see the server's error log for
    an entry beginning with: Server Esception beginning with PPR, #14
    _______________________________

  • No statement parsed error

    I have to first mention that this thing called ORACLE is totally headache. Don't really understand why people choose it. One of those stupid companies is the one where I work.It's just like an "I don't like this, I don't like that"girl. So many problems, so many things you have to coonsider, so many weird exceptions.
    Ok my problem is I have a stored procedure. It receives bunch of parameters one of which is V_CUR OUT SYS_REFCURSOR and another is a V_TYPE IN NUMBER. In the body of my procedure I check for the value of the V_TYPE, if its 0 then the procedure opens V_CUR for a query, if its 1 then the procedure inserts the values passed with rest of the parameters to a table.here are the problems I fase:
    1. If I run this procedure on SQL Developer it executes as expected, but if I do it by using ODP.NET it just takes whatever the default value is for V_TYPE parameter and just ignores the value I pass from the application.
    2. Now the wirdest thing is then if I remove the DEFAULT value from the V_TYPE I get "No statement parsed error".
    Here's my procedure just in case someone will have patience to review it:
    create or replace
    PROCEDURE "SP_IU_AGPENSIONERS"(
    V_PENSIONERID IN NUMBER DEFAULT NULL,
    V_DEPARTID IN NUMBER DEFAULT NULL,
    V_PENSIONTYPE IN NUMBER DEFAULT NULL,
    V_PLASTNAME IN VARCHAR2 DEFAULT NULL,
    V_PNAME IN VARCHAR2 DEFAULT NULL,
    V_PFATHERNAME IN VARCHAR2 DEFAULT NULL,
    V_PERIDTYPE IN NUMBER DEFAULT NULL,
    V_PERIDSER IN VARCHAR2 DEFAULT NULL,
    V_PERIDNO IN VARCHAR2 DEFAULT NULL,
    V_PGENDER IN NUMBER DEFAULT NULL,
    V_PBIRTHDAY IN DATE DEFAULT NULL,
    V_NATIONALITYID IN NUMBER DEFAULT NULL,
    V_PROTOCOLNO IN VARCHAR2 DEFAULT NULL,
    V_ORDERDATE IN DATE DEFAULT NULL,
    V_APPLYDATE IN DATE DEFAULT NULL,
    V_WEYEAR2006 IN NUMBER DEFAULT NULL,
    V_WEMONTH2006 IN NUMBER DEFAULT NULL,
    V_WEDAY2006 IN NUMBER DEFAULT NULL,
    V_ST IN NUMBER DEFAULT NULL,
    V_PFIELD IN NUMBER DEFAULT NULL,
    V_CUR OUT SYS_REFCURSOR,
    V_TYPE IN NUMBER DEFAULT 0)
    IS
    TYPE_SELECT CONSTANT NUMBER:=0;
    TYPE_INSERT CONSTANT NUMBER:=1;
    TYPE_UPDATE CONSTANT NUMBER:=2;
    TYPE_DELETE CONSTANT NUMBER:=3;
    BEGIN
    IF V_TYPE=TYPE_SELECT THEN
    OPEN V_CUR FOR SELECT PENSIONERID, DEPARTID, PENSIONTYPE, PLASTNAME, PNAME,
    PFATHERNAME, PERIDTYPE, PERIDSER, PERIDNO, PGENDER, PBIRTHDAY,
    NATIONALITYID, PROTOCOLNO, ORDERDATE, APPLYDATE, WEYEAR2006, WEMONTH2006,
    WEDAY2006, ST FROM AGAPUS.AGPENSIONERS WHERE ROWNUM<101 ORDER BY
    PENSIONERID;
    ELSIF V_TYPE=TYPE_INSERT THEN
    INSERT
    INTO
    AGPENSIONERS
    PENSIONERID,
    DEPARTID,
    PENSIONTYPE,
    PLASTNAME,
    PNAME,
    PFATHERNAME,
    PERIDTYPE,
    PERIDSER,
    PERIDNO,
    PGENDER,
    PBIRTHDAY,
    NATIONALITYID,
    PROTOCOLNO,
    ORDERDATE,
    APPLYDATE,
    WEYEAR2006,
    WEMONTH2006,
    WEDAY2006,
    PFIELD
    VALUES
    V_PENSIONERID,
    V_DEPARTID,
    V_PENSIONTYPE,
    V_PLASTNAME,
    V_PNAME,
    V_PFATHERNAME,
    V_PERIDTYPE,
    V_PERIDSER,
    V_PERIDNO,
    V_PGENDER,
    V_PBIRTHDAY,
    V_NATIONALITYID,
    V_PROTOCOLNO,
    V_ORDERDATE,
    V_APPLYDATE,
    V_WEYEAR2006,
    V_WEMONTH2006,
    V_WEDAY2006,
    V_PFIELD
    END IF;
    END;
    Edited by: Mikail on Apr 12, 2012 5:12 AM

    Somebody asked nearly the same question Re: EMERGENCY! pl/sql syntax error!!!

  • State service error when submitting InfoPath form to Library

    I have a problem and looks like Google couldn't help me.. I really hope someone here will be able to.
    I have a Form Library using a custom form. When submitting the form to the library, users are getting this error. I don't get the error with my own user, only difference is I have full access to the farm and content using web app policy.
    ULS logs give me few informations
    SharePoint Server
    State Service
    bm1k
    Medium
    StateSqlSession.GetItemBytesInternal() Locked row in database for key ba18f90ee2e844468b08e90ad96dff2c_05967b71a21948d39b7d4d3ada9b27c9 for 4 seconds
    SharePoint Server
    State Service
    bm0t
    Unexpected
    StateManager.GetState() Locked data (05967b71-a219-48d3-9b7d-4d3ada9b27c9)
    InfoPath Forms Services
    Runtime - State Service
    b5st
    Medium
    MOSS StateService threw an exception: A Microsoft SharePoint Server State Service error occurred while processing your request. For more information, contact your server farm administrator.
    I deleted the State Service and recreated it twice, once with PowerShell and then with the Farm Configuration wizard. Restarted the server. Problem might come from InfoPath Forms Services tho but I don't what else I can do.
    Does anyone have any clue??
    JP Berube | MCTS SharePoint 2010 Configuration and Application Development

    Hi,
    We had the same problem with InfoPath.
    After analysis of servers,it turns out that
    the anonymous user authentication has been enabled on
    the web application server
    via IIS and not via SharePoint
    (unsupported configuration), causing
    side-effects on some queries which
    calls to forms.
    We disabled anonymous access.This desactivation
    causes the functioning of forms again.
    Rachid.

  • On Creative Cloud,Photoshop CC Trial (or any other Adobe programs) does not download , States "Download error  Press Retry to try again... (49)". How can I resolve this?

    On Creative Cloud,Photoshop CC Trial (or any other Adobe programs) does not download , States "Download error  Press Retry to try again... (49)". How can I resolve this?

    Try logging out of the CC Application and restarting your computer. Also, try running the CC app as an administrator.
    Benjamin

  • Cannot open document (Error: INF) / Session is closed (Error: INF )

    SAP BO XI3.1
    last time I face this one but suddenly disappear during testing, now we once again face this issue. As all users are member of group 'EveryOne' if we add any user membership to administrator group / master group this error resolved for this user.but that is not proper solutions, so far i m unable to find the rights which is lacking to all user for these report which are available in each user infoview and causing these errors while viewing.
    Open Document error message:
    While viewing Web Intelligence reports
    [Session is closed (Error: INF )|http://yfrog.com/0cwebirightsp|Session is closed (Error: INF )]
    While viewing Desktop Intelligence reports
    [Cannot open document (Error: INF )|http://yfrog.com/mjdeskirightsp|Cannot open document (Error: INF )]

    You might need to give read rights to the folder and category this report belongs to???
    If the problem is fixed when the user who is viweing is an administrator, this means there is insufficient privileges for the other users.

  • Invalid State Identifier Error

    Hi All,
    I have implemented breadcrumb by using "a href="javascript:history.back()". The naviagtion is upto 5 repots and hence the breadcrumb will have 5 links. The issue is sometimes i get "Invalid State identifier" error with some random number when i click on any link in the breadcrumb.
    Unable to trace the root cause of this issue. Please provide your thoughts.
    Regards,
    Swati

    Thanks!!! Do you have any idea about Invalid state error? I have tried inserting the following as suggested by Oracle but doesnt help much.
    <StatePool>
    <MemoryExpireMinutes> 1440 </MemoryExpireMinutes>
    <DiskCleanupIntervalMinutes> 1440 </DiskCleanupIntervalMinutes>
    </StatePool>
    Regards,
    Swati

  • FTP Adapter ORABPEL-11407 Connection closed error.

    Hiiii friends
    I have configured the connection factory for FTP Adapter (not defined any connection pool). My BPEL process poll the ftp location to get the file.
    But no bpel instance is getting generated and domain.log shows the following error. Can you help me in this issue ?
    +<2009-06-26 04:09:59,140> <INFO> <default.collaxa.cube.engine.deployment> Process "ReadEmp" (revision "1.0") successfully loaded.+
    +<2009-06-26 04:10:10,666> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::init - Initializing the JCA activation age+
    nt, processId='bpel://localhost/default/ReadEmp~1.0/
    +<2009-06-26 04:10:10,667> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and+
    initializing inbound JCA endpoint for:
    process='bpel://localhost/default/ReadEmp~1.0/'
    +<2009-06-26 04:10:10,667> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and+
    initializing inbound JCA endpoint for:
    process='bpel://localhost/default/ReadEmp~1.0/'
    domain='default'
    WSDL location='ReadEmpPL.wsdl'
    portType='GetEmpOp_ptt'
    operation='GetEmpOp'
    +activation properties={portType=GetEmpOp_ptt}+
    +<2009-06-26 04:10:10,678> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - endpointActivation for p+
    ortType=GetEmpOp_ptt, operation=GetEmpOp
    +<2009-06-26 04:10:10,763> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> ENDPOINT ACTIVATION CALLED IN FTP ADAPTER+
    +<2009-06-26 04:10:10,765> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - successfully completed e+
    ndpointActivation for portType=GetEmpOp_ptt, operation=GetEmpOp
    +<2009-06-26 04:10:10,765> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Connection Created+
    +<2009-06-26 04:10:40,516> <WARN> <default.collaxa.cube.activation> <File Adapter::Inbound> PollWork::run exiting, Worker thread will die+
    +<2009-06-26 04:20:11,382> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Poller raising Alert for exception : ORABPEL-11407+
    Connection closed error.
    Connection closed for Host: corpdevapp10.
    Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    +<2009-06-26 04:20:41,429> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Connection Created+
    I am not sure what exactly is happening here. I have already established the successful connection with the same FTP server using different FTP clients.

    sounds like the ftp server closed the connection. did you try to use other ftp clients from the same machine where the bpel engine is running?
    Mark

  • I have previewed my book but after cliking BUY BOOK it compiles it OK but then it always states an error after of during uploading it to the store.  How can I rectify this?

    I have previewed my book but after cliking BUY BOOK it compiles it OK but then it always states an error after of during uploading it to the store.
    How can I rectify this?

    I have previewed my book but after cliking BUY BOOK it compiles it OK but then it always states an error after of during uploading it to the store.
    How can I rectify this?

  • RE: Getting ORA-01003: no statement parsed error

    Hi,
    It looks familiar to some of the error which I encountered before. The
    situation was a for ... select loop without explicit begin/end transaction.
    The reason given by Forte consultant is that:
    The dbsession used by the for ... select loop needed to be locked by a
    begin/end transaction otherwise, there may be chances that the dbsession is
    being acquired by some other sql that unknowingly corrupted the cursor
    implicitly built for that for ... select loop.
    Hopes this help.
    Regards,
    Peter Sham.
    -----Original Message-----
    From: Robinson, Richard [SMTP:[email protected]]
    Sent: Friday, April 16, 1999 12:12 AM
    To: '[email protected]'
    Subject: Getting ORA-01003: no statement parsed error
    Any clues? We're getting the following error on a server side
    object that
    interfaces to Oracle:
    SYSTEM ERROR: Select failed for SQL statement in project xxxx, class
    yyy,
    method ...
    error from database is: ORA-01003:no statement parsed
    Class: qqdb_ResourceException
    Detected at: qqdb_OracleVendorInfo::DoOexfet
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Somebody asked nearly the same question Re: EMERGENCY! pl/sql syntax error!!!

Maybe you are looking for

  • 10.8.2 Update Causes Skype and Chrome to Crash

    I just finished the OSX 10.8.2 update and now Skype and Chrome/Rockmelt won't open on my Macbook Pro. I get the following error message: "RockMelt (or Chrome/Skype) quit unexpectedly. Click Reopen to open the application again. Click Report to see mo

  • Oracle ADF VO old value problem.

    I have a web application developed Oracle ADF and Jdev 11.1.2.3.0. I have a button in my page which name is "Complaint". When user click the button, it invokes a method on ApplicationModuleImpl via a ManagedBean. public void clearAndExecute(){ getCar

  • BILLING DOCUMENT NO RANGE

    Dear Scenario is such as follows: If  current invoice number is at say 9055555. Created a new number range just for the S2 cancellations starting at say 9088888. Now all newly created S1's will use this 9088888 range. I will have to manually manage S

  • Opening Youtube makes Firefox unresponsive off-and-on.

    I'm currently running FF 30.0 with Shockwave Flash 14.0.0.145 in Windows 8.1. Whenever I open Youtube, Firefox immediately becomes unresponsive for a few seconds, after which it alternates between being responsive and unresponsive. This is just from

  • UnmarshalException - java.io.EOFException

    I am getting the following exception while trying to lookup an API. java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: java.io.EOFException What is the reason for getting this exception?