Subject | java.sql.DataTrucation exception with long table names metadata access methods |
---|---|
Author | pablojavierpy |
Post date | 2003-12-31T12:02:03Z |
Hi all!
I think I found a bug in firebird-jca-jdbc-driver.
Here is a description of it:
I am using:
-> Database: INTERBASE 6.01 under Linux
-> JDBC driver firebird-jca-jdbc-driver 1.0.1 (downloaded from
sourceforge under the name of FirebirdSQL-1.0.1.zip)
-> J2SDKSE 1.4.2_03 (tried with 1.4.1_01 also. Same BUG) under windows
When I try to extract primary key information from a table with
DatabaseMetadata interface I have a java.sql.DataTrucation exception
when table name is 31 characters long (I think this is Interbase's
maximum limit for a table name).
You can certainly test this is true with this small test case:
-------------------
import java.sql.*;
public class JaybirdErrorTestCase {
public static void main(String[] args) {
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection conn = DriverManager.getConnection(
"jdbc:firebirdsql://192.168.16.5//opt/interbase/data/tape-central.gdb?sql_role_name=ROSHKA",
"sysdba",
"asdf"
);
conn.setAutoCommit(false);
// This will throw an java.sql.DataTruncation exception!!!
// Only happens with 31 character length table names!!!
ResultSet rs = conn.getMetaData().getPrimaryKeys(null, null,
"PLANILLAS_PREVISION_MANTENIMIEN");
} catch (Exception e) {
e.printStackTrace();
}
}
}
-------------------
Anybody in this list is from driver's development team that can give
an answer?
I certainly don't want to change table names because I have a Delphi
front end already deployed in a production environment with this
tables related.
Anybody can help?
Thank you all in advance...
I think I found a bug in firebird-jca-jdbc-driver.
Here is a description of it:
I am using:
-> Database: INTERBASE 6.01 under Linux
-> JDBC driver firebird-jca-jdbc-driver 1.0.1 (downloaded from
sourceforge under the name of FirebirdSQL-1.0.1.zip)
-> J2SDKSE 1.4.2_03 (tried with 1.4.1_01 also. Same BUG) under windows
When I try to extract primary key information from a table with
DatabaseMetadata interface I have a java.sql.DataTrucation exception
when table name is 31 characters long (I think this is Interbase's
maximum limit for a table name).
You can certainly test this is true with this small test case:
-------------------
import java.sql.*;
public class JaybirdErrorTestCase {
public static void main(String[] args) {
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection conn = DriverManager.getConnection(
"jdbc:firebirdsql://192.168.16.5//opt/interbase/data/tape-central.gdb?sql_role_name=ROSHKA",
"sysdba",
"asdf"
);
conn.setAutoCommit(false);
// This will throw an java.sql.DataTruncation exception!!!
// Only happens with 31 character length table names!!!
ResultSet rs = conn.getMetaData().getPrimaryKeys(null, null,
"PLANILLAS_PREVISION_MANTENIMIEN");
} catch (Exception e) {
e.printStackTrace();
}
}
}
-------------------
Anybody in this list is from driver's development team that can give
an answer?
I certainly don't want to change table names because I have a Delphi
front end already deployed in a production environment with this
tables related.
Anybody can help?
Thank you all in advance...