aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-03-15 07:12:07 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-03-15 07:12:07 +0000
commit31a925c4d07675bc098a742ee9ca642ec79a40ee (patch)
tree56f9d42edf130331e135b3b5599c11ee4fe592a3 /src
parent7eddadee8726fbeba5c8d69dda480a3bbbc5d91a (diff)
downloadpostgresql-31a925c4d07675bc098a742ee9ca642ec79a40ee.tar.gz
postgresql-31a925c4d07675bc098a742ee9ca642ec79a40ee.zip
From: Peter T Mount <patches@maidast.demon.co.uk>
Ok, this fixes three things: 1. It seems (from tests submitted by two people with JBuilder) that JBuilder expects a responce from ResultSetMetaData.getPrecision() & getScale() when used on non numeric types. This patch makes these methods return 0, instead of throwing an exception. 2. Fixes a small bug where getting the postgresql type name returns null. 3. Fixes a problem with ResultSet.getObject() where getting it's string value returns null if you case the object as (PGobject), but returns the value if you case it as it's self.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/jdbc/postgresql/Field.java3
-rw-r--r--src/interfaces/jdbc/postgresql/ResultSetMetaData.java4
-rw-r--r--src/interfaces/jdbc/postgresql/util/PGobject.java2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/interfaces/jdbc/postgresql/Field.java b/src/interfaces/jdbc/postgresql/Field.java
index 78553dd32eb..dd8918e99b7 100644
--- a/src/interfaces/jdbc/postgresql/Field.java
+++ b/src/interfaces/jdbc/postgresql/Field.java
@@ -58,7 +58,8 @@ public class Field
if (result.getColumnCount() != 1 || result.getTupleCount() != 1)
throw new SQLException("Unexpected return from query for type");
result.next();
- sql_type = getSQLType(result.getString(1));
+ type_name = result.getString(1);
+ sql_type = getSQLType(type_name);
result.close();
}
return sql_type;
diff --git a/src/interfaces/jdbc/postgresql/ResultSetMetaData.java b/src/interfaces/jdbc/postgresql/ResultSetMetaData.java
index c4e54dbefaa..fefd3bafdce 100644
--- a/src/interfaces/jdbc/postgresql/ResultSetMetaData.java
+++ b/src/interfaces/jdbc/postgresql/ResultSetMetaData.java
@@ -266,7 +266,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
case Types.DOUBLE:
return 16;
default:
- throw new SQLException("no precision for non-numeric data types.");
+ return 0;
}
}
@@ -295,7 +295,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
case Types.DOUBLE:
return 16;
default:
- throw new SQLException("no scale for non-numeric data types");
+ return 0;
}
}
diff --git a/src/interfaces/jdbc/postgresql/util/PGobject.java b/src/interfaces/jdbc/postgresql/util/PGobject.java
index 62b3d55f5ef..40e4daf4354 100644
--- a/src/interfaces/jdbc/postgresql/util/PGobject.java
+++ b/src/interfaces/jdbc/postgresql/util/PGobject.java
@@ -97,6 +97,6 @@ public class PGobject implements Serializable,Cloneable
*/
public String toString()
{
- return value;
+ return getValue();
}
}