Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3daad2a

Browse files
author
Dave Cramer
committed
case sensitive updates by Kris Jurka
1 parentb222867 commit3daad2a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
importorg.postgresql.util.PSQLException;
1616

1717

18-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.10 2002/11/04 06:42:33 barry Exp $
18+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.11 2002/12/23 16:12:36 davec Exp $
1919
* This class defines methods of the jdbc2 specification. This class extends
2020
* org.postgresql.jdbc1.AbstractJdbc1ResultSet which provides the jdbc1
2121
* methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2ResultSet
@@ -1009,7 +1009,9 @@ public synchronized void updateRow()
10091009
{
10101010

10111011
Stringcolumn = (String)columns.nextElement();
1012-
updateSQL.append(column +"= ?");
1012+
updateSQL.append("\"");
1013+
updateSQL.append(column );
1014+
updateSQL.append("\" = ?");
10131015

10141016
if (i <numColumns -1 )
10151017
{
@@ -1026,7 +1028,9 @@ public synchronized void updateRow()
10261028
{
10271029

10281030
PrimaryKeyprimaryKey = ((PrimaryKey)primaryKeys.get(i));
1029-
updateSQL.append(primaryKey.name).append("= ?");
1031+
updateSQL.append("\"");
1032+
updateSQL.append(primaryKey.name);
1033+
updateSQL.append("\" = ?");
10301034

10311035
if (i <numKeys -1 )
10321036
{
@@ -1328,7 +1332,16 @@ boolean isUpdateable() throws SQLException
13281332
else
13291333
{
13301334
// otherwise go and get the primary keys and create a hashtable of keys
1331-
java.sql.ResultSetrs = ((java.sql.Connection)connection).getMetaData().getPrimaryKeys("","",tableName);
1335+
// if the user has supplied a quoted table name
1336+
// remove the quotes, but preserve the case.
1337+
// otherwise fold to lower case.
1338+
StringquotelessTableName;
1339+
if (tableName.startsWith("\"") &&tableName.endsWith("\"")) {
1340+
quotelessTableName =tableName.substring(1,tableName.length()-1);
1341+
}else {
1342+
quotelessTableName =tableName.toLowerCase();
1343+
}
1344+
java.sql.ResultSetrs = ((java.sql.Connection)connection).getMetaData().getPrimaryKeys("","",quotelessTableName);
13321345

13331346

13341347
for (;rs.next();i++ )

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp