1 Reply Latest reply on May 30, 2003 1:51 PM by Michael Meyer

    mssql 2k type-mapping to CHAR

    Michael Meyer Newbie

      Hi,

      I have a char field in my Entity. The Entity could create a table on
      MS-SQL2000 database.

      I use the default type-mapping from jboss3.0.4:


      <java-type>java.lang.Character</java-type>
      <jdbc-type>CHAR</jdbc-type>
      <sql-type>CHAR</sql-type>



      The creation is successfull but when new row should be inserted the following exception occured:

      19:38:54,423 INFO [BookingMgrBean] createBooking: invoked
      19:38:54,567 ERROR [BookingEntityEJB] Could not create entity
      javax.ejb.EJBException: Internal error setting parameters for field booking_mode; CausedByException is:
      [Microsoft][SQLServer 2000 Driver for JDBC]Unable to determine the type of the specified object.
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:297)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbstractCMPFieldBridge.java:270)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:192)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:527)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInte


      when I change the mapping to:

      <java-type>java.lang.Character</java-type>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR</sql-type>


      everything works fine. (Or when I use postgres instead of MS).

      Well the question is I should use the CHAR in the DB instead of VARCHAR. So any idea what I could do?

      Thanks in advance.