Issue Details (XML | Word | Printable)

Key: JDBC-106
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Roman Rokytskyy
Reporter: Slawomir Mezyk
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

table column metadata not returned when table name contains lowercase letters

Created: 24/Oct/07 05:37 PM   Updated: 24/Feb/08 11:13 AM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.1, Jaybird 2.2
Fix Version/s: Jaybird 2.1.3, Jaybird 2.2

Time Tracking:
Original Estimate: 1 hour
Original Estimate - 1 hour
Remaining Estimate: 1 hour
Remaining Estimate - 1 hour
Time Spent: Not Specified
Remaining Estimate - 1 hour

Environment: environment independent


 Description  « Hide
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();



 All   Comments   Work Log   Change History   Version Control   FishEye      Sort Order: Ascending order - Click to sort in descending order
Roman Rokytskyy added a comment - 24/Feb/08 11:13 AM
Fixed