File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Unsupported Data Conversion - How to solve? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Unsupported Data Conversion - How to solve?" Watch "Unsupported Data Conversion - How to solve?" New topic

Unsupported Data Conversion - How to solve?

Fergus Red
Ranch Hand

Joined: Apr 25, 2002
Posts: 42
I am trying to change from a jdbc-odbc driver to a jdbc driver for a web sire which is created using EJB architecture.
I am changing to a SQLServer jdbc driver and as my web site is running and deployed off a JRUN 3.1 application server, I am moving to use a jdbc:jrun:sqlserver jdbc driver.
I have created a datasource using this driver and deployed my changes to the server.
My web site seems to run fine in reading data from the database but I get an error when i try to connect from a session bean to a create method in one of my entity beans. The error I get is an "[JRun][SQLServer JDBC]Unsupported Data Conversion error"

My error occurs at the following code:

try {
contactEvent = contactEventHome.create(sessionKey, sessionKey, interactiveItemKey, zccountKey, treatKey,
methodOfContact, promoCode, direction);
return ((ContactEventPK)contactEvent.getPrimaryKey()).contactEventKey;
catch (CreateException ce) {
throw new EJBException("ContactSys - failed to create new ContactEvent");
}catch (java.rmi.RemoteException re) {
throw new javax.ejb.EJBException(re);
The error is thrown within the "catch (java.rmi.RemoteException re) {" statement.

DO you know why my error is occuring, and how I can solve this?
Cheers in Advance.
Greg Charles

Joined: Oct 01, 2001
Posts: 2967

When you create an entity bean, you create an equivalent record in your database. I think what your error means is you have defined one of the fields in that object to have a type that is incompatible with the type of the corresponding database field. For example, you have a customerID field in the entity bean defined as an integer, but you map it to CUST_ID in the database, which is a String.
Fergus Red
Ranch Hand

Joined: Apr 25, 2002
Posts: 42
Cheers for the help. I'll try and determine compatibality between my database and driver now.
Fergus Red
Ranch Hand

Joined: Apr 25, 2002
Posts: 42
I found out that my unsupported Data Conversion occurs as a result of trying to return an integer from my Create ststement.
I am trying to reurn the key from the database but cannot seem to do so without recieving an error.
Does anyone have any more suggestions on why thiw may be occuring and how to solve it?
I agree. Here's the link:
subject: Unsupported Data Conversion - How to solve?
It's not a secret anymore!