summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/Field.java
diff options
context:
space:
mode:
authorPeter Mount <peter@retep.org.uk>2001-02-13 16:39:06 +0000
committerPeter Mount <peter@retep.org.uk>2001-02-13 16:39:06 +0000
commit3d21bf82c3e27396bd3598810cbcc6f7cdc05adf (patch)
tree0701214cf100311bc15314ae39a3ece1667729e9 /src/interfaces/jdbc/org/postgresql/Field.java
parent2410963e8cc6272022c0a556a3fd3c9a3bd617e9 (diff)
downloadpostgresql-3d21bf82c3e27396bd3598810cbcc6f7cdc05adf.tar.gz
Some more including the patch to DatabaseMetaData backed out by Bruce.
Tue Feb 13 16:33:00 GMT 2001 peter@retep.org.uk - More TestCases implemented. Refined the test suite api's. - Removed need for SimpleDateFormat in ResultSet.getDate() improving performance. - Rewrote ResultSet.getTime() so that it uses JDK api's better. Tue Feb 13 10:25:00 GMT 2001 peter@retep.org.uk - Added MiscTest to hold reported problems from users. - Fixed PGMoney. - JBuilder4/JDBCExplorer now works with Money fields. Patched Field & ResultSet (lots of methods) for this one. Also changed cash/money to return type DOUBLE not DECIMAL. This broke JBuilder as zero scale BigDecimal's can't have decimal places! - When a Statement is reused, the previous ResultSet is now closed. - Removed deprecated call in ResultSet.getTime() Thu Feb 08 18:53:00 GMT 2001 peter@retep.org.uk - Changed a couple of settings in DatabaseMetaData where 7.1 now supports those features - Implemented the DatabaseMetaData TestCase. Wed Feb 07 18:06:00 GMT 2001 peter@retep.org.uk - Added comment to Connection.isClosed() explaining why we deviate from the JDBC2 specification. - Fixed bug where the Isolation Level is lost while in autocommit mode. - Fixed bug where several calls to getTransactionIsolationLevel() returned the first call's result.
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/Field.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/Field.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/Field.java b/src/interfaces/jdbc/org/postgresql/Field.java
index b73c224e51..6450858843 100644
--- a/src/interfaces/jdbc/org/postgresql/Field.java
+++ b/src/interfaces/jdbc/org/postgresql/Field.java
@@ -16,12 +16,12 @@ public class Field
public int oid; // OID of the type
public int mod; // type modifier of this field
public String name; // Name of this field
-
+
protected Connection conn; // Connection Instantation
-
+
public int sql_type = -1; // The entry in java.sql.Types for this field
public String type_name = null;// The sql type name
-
+
/**
* Construct a field based on the information fed to it.
*
@@ -38,7 +38,7 @@ public class Field
this.length = length;
this.mod = mod;
}
-
+
/**
* Constructor without mod parameter.
*
@@ -51,7 +51,7 @@ public class Field
{
this(conn,name,oid,length,0);
}
-
+
/**
* @return the oid of this Field's data type
*/
@@ -59,7 +59,7 @@ public class Field
{
return oid;
}
-
+
/**
* the ResultSet and ResultMetaData both need to handle the SQL
* type, which is gained from another query. Note that we cannot
@@ -72,7 +72,7 @@ public class Field
{
if(sql_type == -1) {
type_name = (String)conn.fieldCache.get(new Integer(oid));
-
+
// it's not in the cache, so perform a query, and add the result to
// the cache
if(type_name==null) {
@@ -84,12 +84,12 @@ public class Field
conn.fieldCache.put(new Integer(oid),type_name);
result.close();
}
-
+
sql_type = getSQLType(type_name);
}
return sql_type;
}
-
+
/**
* This returns the SQL type. It is called by the Field and DatabaseMetaData classes
* @param type_name PostgreSQL type name
@@ -103,7 +103,7 @@ public class Field
sql_type=typei[i];
return sql_type;
}
-
+
/**
* This table holds the org.postgresql names for the types supported.
* Any types that map to Types.OTHER (eg POINT) don't go into this table.
@@ -128,7 +128,7 @@ public class Field
"time",
"abstime","timestamp"
};
-
+
/**
* This table holds the JDBC type for each entry above.
*
@@ -140,7 +140,7 @@ public class Field
Types.SMALLINT,
Types.INTEGER,Types.INTEGER,
Types.BIGINT,
- Types.DECIMAL,Types.DECIMAL,
+ Types.DOUBLE,Types.DOUBLE,
Types.NUMERIC,
Types.REAL,
Types.DOUBLE,
@@ -151,7 +151,7 @@ public class Field
Types.TIME,
Types.TIMESTAMP,Types.TIMESTAMP
};
-
+
/**
* We also need to get the type name as returned by the back end.
* This is held in type_name AFTER a call to getSQLType. Since