File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unsupported Data Conversion - How to solve?

 
Fergus Red
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers for the help. I'll try and determine compatibality between my database and driver now.
 
Fergus Red
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic