1 Reply Latest reply on Oct 28, 2004 10:33 AM by cosmos38240

    conn.prepareStatement failed

    cosmos38240 Newbie

      Hi,

      I try to execute this tutorial :
      http://www.tusc.com.au/tutorial/html/chap3.html

      when i execute this code :

      conn = jdbcFactory.getConnection();
       String queryString = "select userid from storeaccess where username=? and password=?";
       ps = conn.prepareStatement(queryString);
       ps.setString(1, username);
      


      I go to error on conn.prepareStatement

      how could i know the reason ???

      Thank you

        • 1. Re: conn.prepareStatement failed
          cosmos38240 Newbie

          this my log :

          Caused by: java.lang.NullPointerException
           at au.com.tusc.dao.StoreAccessDAOImpl.loginUser(StoreAccessDAOImpl.java:70)
           at au.com.tusc.session.StoreAccessSession.loginUser(StoreAccessSession.java:61)
           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:324)
           at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
           at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
           at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
           at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113)
           at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
           at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
           at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
           at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
           at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
           at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
           at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
           ... 25 more