Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2b3bb34

Browse files
committed
This patch fixes a couple of minor bugs:
1) DatabaseMetaData.getPrimaryKeys() would fail saying that there is no table t. 2) PreparedStatement.getObject() was missing some break statements, which was causing updates not to work with JBuilder (supplied by Aaron Dunlop). jdbc fixes from Peter.
1 parent 55c235b commit 2b3bb34

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/interfaces/jdbc/postgresql/DatabaseMetaData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ public java.sql.ResultSet getPrimaryKeys(String catalog, String schema, String t
21212121
"ic.relname AS COLUMN_NAME," +
21222122
"'1' as KEY_SEQ,"+ // -- fake it as a String for now
21232123
"t.typname as PK_NAME " +
2124-
" FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a " +
2124+
" FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a, pg_type t " +
21252125
" WHERE relkind = 'r' " + // -- not indices
21262126
" and bc.relname ~ '"+table+"'" +
21272127
" and i.indrelid = bc.oid" +

src/interfaces/jdbc/postgresql/PreparedStatement.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,19 @@ public void setObject(int parameterIndex, Object x, int targetSqlType, int scale
470470
case Types.VARCHAR:
471471
case Types.LONGVARCHAR:
472472
setString(parameterIndex, x.toString());
473+
break;
473474
case Types.DATE:
474475
setDate(parameterIndex, (java.sql.Date)x);
476+
break;
475477
case Types.TIME:
476478
setTime(parameterIndex, (Time)x);
479+
break;
477480
case Types.TIMESTAMP:
478481
setTimestamp(parameterIndex, (Timestamp)x);
482+
break;
479483
case Types.OTHER:
480484
setString(parameterIndex, ((PGobject)x).getValue());
485+
break;
481486
default:
482487
throw new SQLException("Unknown Types value");
483488
}

0 commit comments

Comments
 (0)