If its datetime you are talking about, add this to the data database-schema definition to sql-server:

<type-mapping type="java.util.Date" name="datetime" />

java.io.Serializable is the mapping for varbinary, to use image add the following to the database-schema:

<type-mapping type="java.io.Serializable" name="image" />

Only thing i can think of :)

Have fun with it.....

Klaus

 

-----Opprinnelig melding-----
Fra: fresnaULL [mailto:[EMAIL PROTECTED]]
Sendt: 27. november 2000 15:59
Til: Orion-Interest
Emne: Data type to access a datetime field in database

Hi,
I'm trying to access a datatime field in a SQL-SERVER 7.0 with a EJB CMP but
I don't know which java type I have to use in the bean to map this field. I've tried with a java.util.Date type but
I get the following error:
 
javax.ejb.EJBException: Error saving state: [Microsoft] [ODBC SQL Server Driver] Datatime field overflow
    at Persona_EntityBeanWrapper0.saveState(Persona_EntityBeanWrapper0.java:3092)
    at Persona_EntityBeanWrapper0.setPer_fecha_nac(Persona_EntityBeanWrapper0.java:2964)
    at NewCmp.doGet(NewCmp.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at com.evermind.server.http.d1.si(JAX)
    at com.evermind.server.http.d1.forward(JAX)
    at com.evermind.server.http.ed.sp(JAX)
    at com.evermind.server.http.ed.so(JAX)
    at com.evermind.util.f.run(JAX
Also, I'm trying to access an image type field but I have no idea which java type I have to use to map this kind of field.
 
Does anybody know which java type I have to use in both cases?
 
 
Thanks.
 

Reply via email to