• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Unsupported Data Conversion - How to solve?

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic