If I have create the table:
CREATE TABLE T1 (A VARCHAR(10))
I recive the column_size = 20;
DatabaseMetaData dmd = v.fromDB.getMetaData();
ResultSet rs = dmd.getColumns(catalog,null,v.fromDBTable,null);
while(rs.next()){
String column_size = rs.getString("COLUMN_SIZE");
}
This incoherence is only for the ACCESS driver, for DBF or PARADOX the size recived is the sames of the size created.
I can configure the driver to solve this problem?
|
For MS Access 95 and 97(JET3), you will get column_size = 10; A VARCHAR(10)) can store at most 10 ASCII character.
For MS Access 2000, or 2003 (JET4), you will get column_size = 20; because those database has choose unicode character. Because JET4 can use compressed method for string too, a VARCHAR(10)) can store at most 18 Unicode character sometimes.
|
>I can configure the driver to solve this problem?
If that mdb file is created by you, you can use versionNumber=JET3 to create it.
For JET4, we can't let column_size return 10 because 10 ASCII character column of other databases can't store 10 UNICODE characters column in database migration.
|