[Opensource] Type Mapping SQL Server 2000.

Dave Smith davsmith at nbnet.nb.ca
Sat Jun 8 08:30:14 PDT 2002


Thanks Michael ,
I inserted the type mappings you provided into my default config and it 
worked perfectly, ... almost.  
Just two little hang-ups reported in populating the default data to the 
EVENETMAIL table.  

com.jcorporate.expresso.core.db.DBException: Unable to execute 
statement: INSERT INTO EVENTMAIL (Event, Success, ExpUid) VALUES 
('SYSERROR', 'Y', 3)(com.jcorporate.expresso.services.dbobj.EventMail, 
db/context 'default'):[Microsoft][SQLServer 2000 Driver for 
JDBC][SQLServer]Cannot insert explicit value for identity column in 
table 'EVENTMAIL' when IDENTITY_INSERT is set to OFF.
    at 
com.jcorporate.expresso.core.db.DBConnection.executeUpdate(DBConnection.java:597)
    at com.jcorporate.expresso.core.dbobj.DBObject.add(DBObject.java:351)
    at 
com.jcorporate.expresso.core.dbobj.SecuredDBObject.add(SecuredDBObject.java:248)
    at 
com.jcorporate.expresso.services.dbobj.EventMail.populateDefaultValues(EventMail.java:173)
    at 
com.jcorporate.expresso.core.dbobj.Schema.setupDefaultValuesWithException(Schema.java:848)
    at 
com.jcorporate.expresso.core.utility.DBTool.populateTables(DBTool.java:2012)

com.jcorporate.expresso.core.db.DBException: Unable to add record to 
database for record with key 'SYSERROR/3/Y' in database 'default':Unable 
to execute statement: INSERT INTO EVENTMAIL (Event, Success, ExpUid) 
VALUES ('SYSERROR', 'Y', 
3)(com.jcorporate.expresso.services.dbobj.EventMail, db/context 
'default'):[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot 
insert explicit value for identity column in table 'EVENTMAIL' when 
IDENTITY_INSERT is set to OFF. (INSERT INTO EVENTMAIL (Event, Success, 
ExpUid) VALUES ('SYSERROR', 'Y', 3)):[Microsoft][SQLServer 2000 Driver 
for JDBC][SQLServer]Cannot insert explicit value for identity column in 
table 'EVENTMAIL' when IDENTITY_INSERT is set to OFF.
    at com.jcorporate.expresso.core.dbobj.DBObject.add(DBObject.java:354)
    at 
com.jcorporate.expresso.core.dbobj.SecuredDBObject.add(SecuredDBObject.java:248)
    at 
com.jcorporate.expresso.services.dbobj.EventMail.populateDefaultValues(EventMail.java:173)
    at 
com.jcorporate.expresso.core.dbobj.Schema.setupDefaultValuesWithException(Schema.java:848)
    at 
com.jcorporate.expresso.core.utility.DBTool.populateTables(DBTool.java:2012)

Not sure why expresso sets up the ExpUid field  in the EVENTMAIL table 
as an IDENTITY column. I'll do a little more digging.
Many Thanks for the Type-Mappings.

Dave


Michael Rimov wrote:

> At 10:07 PM 6/6/2002 -0300, you wrote:
>
>> Hi,
>> I'm trying to figure out the type mapping for SQL Server 2000.
>> I'm using the MS JDBC driver.
>
>
> Dave, I've been sent this as the current MS-SQL database config file 
> that people are successfully using.  Can you verify that it does or 
> does not work?
>
> Thanks,
>
>                                                         -Mike
> 0-0-0-0-0-0--0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-
>
> <context name="default">
> <description>MSSQL-expresso-intro</description>
> <jdbc
> driver="sun.jdbc.odbc.JdbcOdbcDriver"
> url="jdbc:odbc:expresso-intro"
> connectFormat="1"
> login="sa"
> password=""
> dateSelectFormat="dd-MM-yyyy"
> dateUpdateFormat="dd-MM-yyyy"
> dateTimeSelectFormat="yyyy-MM-dd HH:mm"
> dateTimeUpdateFormat="yyyy-MM-dd HH:mm"
> cache="y"
> createTableIndicies="true">
> <dbWildcard>%</dbWildcard>
> <dbWildcard>*</dbWildcard>
> </jdbc>
> <type-mapping>
> <java-type>DATE</java-type>
> <db-type>datetime</db-type>
> </type-mapping>
> <type-mapping>
> <java-type>DOUBLE</java-type>
> <db-type>NUMERIC</db-type>
> </type-mapping>
> <type-mapping>
> <java-type>LONGVARCHAR</java-type>
> <db-type>VARCHAR(1024)</db-type>
> </type-mapping>
> <type-mapping>
> <java-type>INTEGER</java-type>
> <db-type>int</db-type>
> </type-mapping>
> <type-mapping>
> <java-type>NUMERIC</java-type>
> <db-type>NUMERIC</db-type>
> </type-mapping>
> <images>%context%/%expresso-dir%/images</images>
> <startJobHandler>y</startJobHandler>
> <showStackTrace>y</showStackTrace>
> <mailDebug>n</mailDebug>
> </context>
>
>
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
> http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives: http://mail.jcorporate.com/pipermail/opensource/
>






More information about the Opensource mailing list