1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Additional SQLState work for JDBC - thanks to Kim Ho at Redhat for input on this

Modified Files:
 	jdbc/build.xml jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/util/PSQLState.java
This commit is contained in:
Barry Lind
2003-09-09 10:49:16 +00:00
parent fcdf0e22fc
commit 5cdf771d8a
7 changed files with 50 additions and 44 deletions

View File

@ -6,6 +6,7 @@ import java.util.*;
import org.postgresql.core.BaseStatement;
import org.postgresql.core.Field;
import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState;
import org.postgresql.Driver;
public abstract class AbstractJdbc1DatabaseMetaData
@ -43,7 +44,7 @@ public abstract class AbstractJdbc1DatabaseMetaData
String sql = "SELECT t1.typlen/t2.typlen FROM "+from+" t1.typelem=t2.oid AND t1.typname='oidvector'";
ResultSet rs = connection.createStatement().executeQuery(sql);
if (!rs.next()) {
throw new PSQLException("postgresql.unexpected");
throw new PSQLException("postgresql.unexpected", PSQLState.UNEXPECTED_ERROR);
}
INDEX_MAX_KEYS = rs.getInt(1);
rs.close();
@ -61,7 +62,7 @@ public abstract class AbstractJdbc1DatabaseMetaData
}
ResultSet rs = connection.createStatement().executeQuery(sql);
if (!rs.next()) {
throw new PSQLException("postgresql.unexpected");
throw new PSQLException("postgresql.unexpected", PSQLState.UNEXPECTED_ERROR);
}
NAMEDATALEN = rs.getInt("typlen");
rs.close();