
|
If you were logged in you would be able to see more operations.
|
|
|
|
Time Tracking:
|
|
Original Estimate:
|
1 hour
|
|
|
Remaining Estimate:
|
1 hour
|
|
|
Time Spent:
|
Not Specified
|
|
|
|
|
Environment:
|
environment independent
|
|
|
When table name contains lower case letters, metadata information about table columns is not returned from the driver. Below is code that illustrates the problem:
public class GetColumnsTest {
public static void main(String[] args) throws Exception {
// connection parameters
String databaseURL = "jdbc:firebirdsql:test01";
String user = "sysdba";
String password = "masterkey";
String driverName = "org.firebirdsql.jdbc.FBDriver";
String TableName = "TestTable";
// connect to database
Class.forName(driverName);
java.sql.Connection c = java.sql.DriverManager.getConnection (databaseURL, user, password);
// create table
c.createStatement().execute("CREATE TABLE \"" + TableName + "\" (\"Id\" INT, \"Name\" VARCHAR(20))");
// retrieve table column info
java.sql.DatabaseMetaData md = c.getMetaData();
java.sql.ResultSet rs = md.getColumns("", "", TableName, "%");
// show results (nothing shown if table name has lowercase letters)
while(rs.next()) {
System.out.println(rs.getString(4) + "\t" + rs.getString(6));
}
}
}
This is because table name is always converted to uppercase in function AbstractDatabaseMetadata.stripQuotes when there's no quotation marks to remove. The line 5802 of file src/main/org/firebirdsql/jdbc/AbstractDatabaseMetadata.java should be
return pattern;
instead of
return pattern.toUpperCase();
|
|
Description
|
When table name contains lower case letters, metadata information about table columns is not returned from the driver. Below is code that illustrates the problem:
public class GetColumnsTest {
public static void main(String[] args) throws Exception {
// connection parameters
String databaseURL = "jdbc:firebirdsql:test01";
String user = "sysdba";
String password = "masterkey";
String driverName = "org.firebirdsql.jdbc.FBDriver";
String TableName = "TestTable";
// connect to database
Class.forName(driverName);
java.sql.Connection c = java.sql.DriverManager.getConnection (databaseURL, user, password);
// create table
c.createStatement().execute("CREATE TABLE \"" + TableName + "\" (\"Id\" INT, \"Name\" VARCHAR(20))");
// retrieve table column info
java.sql.DatabaseMetaData md = c.getMetaData();
java.sql.ResultSet rs = md.getColumns("", "", TableName, "%");
// show results (nothing shown if table name has lowercase letters)
while(rs.next()) {
System.out.println(rs.getString(4) + "\t" + rs.getString(6));
}
}
}
This is because table name is always converted to uppercase in function AbstractDatabaseMetadata.stripQuotes when there's no quotation marks to remove. The line 5802 of file src/main/org/firebirdsql/jdbc/AbstractDatabaseMetadata.java should be
return pattern;
instead of
return pattern.toUpperCase();
|
Show » |
|