1 Reply Latest reply on Mar 16, 2004 4:45 AM by spohl

    Sybase DateTime and TimeStamp

    jblasdel

      I am using JBoss 3.2.1 and Sybase ASE.

      From a BMP bean, I am trying pass the current date/time to a Sybase stored procedure.

      When I try, I get the following:
      15:07:34,913 ERROR [STDERR] java.sql.SQLException: Could not execute sql comman
      - Original message: null
      15:07:34,913 ERROR [STDERR] at com.javaunderground.jdbc.DebuggableStatement
      executeUpdate(DebuggableStatement.java:280)
      15:07:34,913 ERROR [STDERR] at amcgates.securityservices.dao.WASOEntityDAOI
      pl.store(WASOEntityDAOImpl.java:121)
      15:07:34,913 ERROR [STDERR] at amcgates.securityservices.ejb.bmp.WASOEntity
      MP.ejbStore(WASOEntityBMP.java:248)
      15:07:34,913 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0
      Native Method)
      15:07:34,913 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(
      ativeMethodAccessorImpl.java:39)
      15:07:34,913 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.inv
      ke(DelegatingMethodAccessorImpl.java:25)
      15:07:34,913 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:
      24)
      15:07:34,928 ERROR [STDERR] at org.jboss.ejb.plugins.BMPPersistenceManager.
      toreEntity(BMPPersistenceManager.java:454)
      15:07:34,928 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedC
      nnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
      15:07:34,928 ERROR [STDERR] at org.jboss.ejb.EntityContainer.storeEntity(En
      ityContainer.java:714)
      15:07:34,928 ERROR [STDERR] at org.jboss.ejb.GlobalTxEntityMap.synchronizeE
      tities(GlobalTxEntityMap.java:149)
      15:07:34,928 ERROR [STDERR] at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEnti
      yMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
      15:07:34,928 ERROR [STDERR] at org.jboss.tm.TransactionImpl.doBeforeComplet
      on(TransactionImpl.java:1308)
      15:07:34,928 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(Transact
      onImpl.java:347)
      15:07:34,928 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.endTr
      nsaction(TxInterceptorCMT.java:398)
      15:07:35,022 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWi
      hTransactions(TxInterceptorCMT.java:277)
      15:07:35,022 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invok
      (TxInterceptorCMT.java:128)
      15:07:35,022 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(
      ogInterceptor.java:191)
      15:07:35,038 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInte
      ceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      15:07:35,038 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer.inter
      alInvoke(StatefulSessionContainer.java:416)
      15:07:35,038 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.jav
      :700)
      15:07:35,038 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0
      Native Method)
      15:07:35,038 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(
      ativeMethodAccessorImpl.java:39)
      15:07:35,038 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.inv
      ke(DelegatingMethodAccessorImpl.java:25)
      15:07:35,038 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:
      24)
      15:07:35,038 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispat
      her.invoke(ReflectedMBeanDispatcher.java:284)
      15:07:35,038 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(M
      eanServerImpl.java:546)
      15:07:35,100 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invo
      e(LocalInvoker.java:101)
      15:07:35,100 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invo
      e(InvokerInterceptor.java:90)
      15:07:35,100 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invok
      (TransactionInterceptor.java:46)
      15:07:35,100 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(S
      curityInterceptor.java:45)
      15:07:35,100 ERROR [STDERR] at org.jboss.proxy.ejb.StatefulSessionIntercept
      r.invoke(StatefulSessionInterceptor.java:104)
      15:07:35,100 ERROR [STDERR] at


      From previous posts I have tried setting:

      <java-type>java.util.Date</java-type>
      <jdbc-type>TIMESTAMP</jdbc-type>
      <sql-type>DATETIME</sql-type>


      in standardjaws.xml with no luck.

      Any help would be appreciated.

        • 1. Re: Sybase DateTime and TimeStamp
          spohl

          I don't know about CMP but with BMP and a simple select with a preparedstatement using java.sql.Date the following works with Sybase ASE and jConnect:

          pstmt.setDate(4, new java.sql.Date(new Date().getTime()));

          Regards,
          S. Pohl