Commit 2b3bb341 authored by Bruce Momjian's avatar Bruce Momjian

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.
parent 55c235b2
......@@ -2121,7 +2121,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
"ic.relname AS COLUMN_NAME," +
"'1' as KEY_SEQ,"+ // -- fake it as a String for now
"t.typname as PK_NAME " +
" FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a " +
" FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a, pg_type t " +
" WHERE relkind = 'r' " + // -- not indices
" and bc.relname ~ '"+table+"'" +
" and i.indrelid = bc.oid" +
......
......@@ -470,14 +470,19 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
case Types.VARCHAR:
case Types.LONGVARCHAR:
setString(parameterIndex, x.toString());
break;
case Types.DATE:
setDate(parameterIndex, (java.sql.Date)x);
break;
case Types.TIME:
setTime(parameterIndex, (Time)x);
break;
case Types.TIMESTAMP:
setTimestamp(parameterIndex, (Timestamp)x);
break;
case Types.OTHER:
setString(parameterIndex, ((PGobject)x).getValue());
break;
default:
throw new SQLException("Unknown Types value");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment