See inlineErik Bengtson-----Original Message-----From: Craig Russell [mailto:Craig.Russell@Sun.COM]Sent: Thursday, July 21, 2005 12:26 AMSubject: Re: Binding a char to PreparedStatement
I was thinking that most of the value in the jdbc-type would be in thejava-to-database schema creation, where the user could rely on the jdoimpl to create appropriate schema. In the case of char or >Character,that would be CHAR(1). In the case of double or Double, with a length of20 and a scale of 12, that would be DOUBLE if the database supported it,or DECIMAL(20, 12) if not.
CHAR(1) will not allow Unicode storage, you need either to use NCHAR(1),CHAR(4) or another type that allows you to store 2 bytes.
We use INTEGERdata type by default which works in all databases, and more, it allowsoperators like > < on SQL queries without having to convert it usingASCII functions.
The origin of the problem Michael reported is down to the lack of ajdbc-typespecification in the metadata, and the fact that JPOX's current"default" forchar is to store it as INTEGER (for whatever reason) - hence why he gottheproblem.
Ok. I thought that you would agree that this is a bug in JPOX, since the"obvious default" for a char column is CHAR.It is not that obvious when you have to support a wide range ofdatabases and data types. The most obvious choice to me is the mostcommon type among these databases.
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!