* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.29 2003/05/29 03:22:48 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.30 2003/05/29 04:39:51 barry Exp $
*
*-------------------------------------------------------------------------
*/
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
{
//This method isn't really implemented
- Properties p = parseURL(url, info);
+ //we just parse the URL to ensure it is valid
+ parseURL(url, info);
return new DriverPropertyInfo[0];
}
{
int state = -1;
Properties urlProps = new Properties(defaults);
- String key = "";
- String value = "";
String l_urlServer = url;
String l_urlArgs = "";
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/fastpath/Attic/Fastpath.java,v 1.13 2003/05/29 03:21:32 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/fastpath/Attic/Fastpath.java,v 1.14 2003/05/29 04:39:51 barry Exp $
*
*-------------------------------------------------------------------------
*/
switch (c)
{
case 'A': // Asynchronous Notify
+ //TODO: do something with this
int pid = stream.ReceiveInteger(4);
String msg = stream.ReceiveString(conn.getEncoding());
break;
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGcircle.java,v 1.4 2003/03/07 18:39:42 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGcircle.java,v 1.5 2003/05/29 04:39:48 barry Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.geometric;
-import java.io.Serializable;
-import java.sql.SQLException;
-import java.util.Hashtable;
import org.postgresql.util.PGobject;
import org.postgresql.util.PGtokenizer;
import org.postgresql.util.PSQLException;
+import java.io.Serializable;
+import java.sql.SQLException;
public class PGcircle extends PGobject implements Serializable, Cloneable
{
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGpoint.java,v 1.4 2003/03/07 18:39:43 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGpoint.java,v 1.5 2003/05/29 04:39:48 barry Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.geometric;
-import java.awt.Point;
-import java.io.Serializable;
-import java.sql.SQLException;
import org.postgresql.util.PGobject;
import org.postgresql.util.PGtokenizer;
import org.postgresql.util.PSQLException;
-
-import org.postgresql.util.*;
+import java.awt.Point;
+import java.io.Serializable;
+import java.sql.SQLException;
/*
* This implements a version of java.awt.Point, except it uses double
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGpolygon.java,v 1.4 2003/03/07 18:39:43 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGpolygon.java,v 1.5 2003/05/29 04:39:48 barry Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.geometric;
-import java.io.Serializable;
-import java.sql.SQLException;
import org.postgresql.util.PGobject;
import org.postgresql.util.PGtokenizer;
-import org.postgresql.util.PSQLException;
+import java.io.Serializable;
+import java.sql.SQLException;
public class PGpolygon extends PGobject implements Serializable, Cloneable
{
*/
public String getDriverVersion() throws SQLException
{
- String driverVersion = connection.this_driver.getVersion();
+ String driverVersion = Driver.getVersion();
if (Driver.logDebug)
Driver.debug("getDriverVersion " + driverVersion);
return driverVersion;
{
Field f[] = new Field[18];
- ResultSet r; // ResultSet for the SQL query that we need to do
Vector v = new Vector(); // The new ResultSet tuple stuff
f[0] = new Field(connection, "TYPE_NAME", iVarcharOid, getMaxNameLength());
package org.postgresql.jdbc1;
-import java.lang.*;
-import java.util.*;
import org.postgresql.core.Field;
-import org.postgresql.util.*;
+import org.postgresql.util.PSQLException;
import java.sql.SQLException;
import java.sql.Types;
+import java.util.Vector;
public abstract class AbstractJdbc1ResultSetMetaData
{
{
Field f = getField(column);
String type_name = f.getPGType();
- int sql_type = f.getSQLType();
int typmod = f.getMod();
// I looked at other JDBC implementations and couldn't find a consistent
package org.postgresql.jdbc1;
-import java.io.*;
-
-import java.math.BigDecimal;
-import java.sql.*;
-import java.util.Vector;
import org.postgresql.core.BaseConnection;
import org.postgresql.core.BaseResultSet;
import org.postgresql.core.BaseStatement;
import org.postgresql.core.Field;
import org.postgresql.core.QueryExecutor;
-import org.postgresql.largeobject.*;
-import org.postgresql.util.*;
+import org.postgresql.largeobject.LargeObject;
+import org.postgresql.largeobject.LargeObjectManager;
+import org.postgresql.util.PGbytea;
+import org.postgresql.util.PGobject;
+import org.postgresql.util.PSQLException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.sql.CallableStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.Vector;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.21 2003/05/03 20:40:45 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.22 2003/05/29 04:39:49 barry Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
package org.postgresql.jdbc2;
-import java.lang.*;
-import java.io.*;
-import java.math.*;
-import java.text.*;
-import java.util.*;
-import java.sql.*;
import org.postgresql.PGConnection;
-import org.postgresql.largeobject.*;
+import org.postgresql.largeobject.LargeObject;
+import org.postgresql.largeobject.LargeObjectManager;
+import java.io.InputStream;
+import java.sql.Blob;
+import java.sql.SQLException;
public abstract class AbstractJdbc2Blob
{
package org.postgresql.jdbc2;
-import java.lang.*;
-import java.io.*;
-import java.math.*;
-import java.text.*;
-import java.util.*;
-import java.sql.*;
import org.postgresql.PGConnection;
-import org.postgresql.largeobject.*;
+import org.postgresql.largeobject.LargeObject;
+import org.postgresql.largeobject.LargeObjectManager;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.sql.Clob;
+import java.sql.SQLException;
public class AbstractJdbc2Clob
{
package org.postgresql.jdbc2;
-import java.io.*;
-import java.net.ConnectException;
-import java.sql.*;
-import org.postgresql.util.PSQLException;
+import java.io.PrintWriter;
+import java.sql.DriverManager;
+import java.sql.SQLData;
+import java.sql.SQLException;
+import java.sql.Types;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Connection.java,v 1.4 2003/03/07 18:39:44 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Connection.java,v 1.5 2003/05/29 04:39:48 barry Exp $
* This class defines methods of the jdbc2 specification. This class extends
* org.postgresql.jdbc1.AbstractJdbc1Connection which provides the jdbc1
* methods. The real Connection class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Connection
package org.postgresql.jdbc2;
-import org.postgresql.jdbc1.AbstractJdbc1ResultSet;
-import java.sql.*;
-import java.util.*;
-
-import org.postgresql.Driver;
-import org.postgresql.core.Field;
-import org.postgresql.util.PSQLException;
+import java.sql.SQLException;
public abstract class AbstractJdbc2DatabaseMetaData extends org.postgresql.jdbc1.AbstractJdbc1DatabaseMetaData
{
package org.postgresql.jdbc2;
-import java.lang.*;
-import java.sql.*;
-import java.util.*;
import org.postgresql.core.Field;
-import org.postgresql.util.*;
+import org.postgresql.util.PSQLException;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.Vector;
public abstract class AbstractJdbc2ResultSetMetaData extends org.postgresql.jdbc1.AbstractJdbc1ResultSetMetaData
{
{
Field f = getField(column);
String type_name = f.getPGType();
- int sql_type = f.getSQLType();
int typmod = f.getMod();
// I looked at other JDBC implementations and couldn't find a consistent
package org.postgresql.jdbc2;
-import java.text.*;
-import java.sql.*;
-import java.util.*;
-import java.math.BigDecimal;
import org.postgresql.core.BaseConnection;
import org.postgresql.core.BaseResultSet;
import org.postgresql.core.BaseStatement;
import org.postgresql.core.Field;
-import org.postgresql.util.*;
+import org.postgresql.util.PSQLException;
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.Vector;
/*
* Array is used collect one column of query result data.
break;
case Types.TIMESTAMP:
retVal = new Timestamp[ count ];
- StringBuffer sbuf = null;
for ( ; count > 0; count-- )
((java.sql.Timestamp[])retVal)[i++] = AbstractJdbc2ResultSet.toTimestamp( arrayContents[(int)index++], rs, getBaseTypeName() );
break;
package org.postgresql.jdbc2;
-import org.postgresql.util.*;
-import java.sql.*;
+import org.postgresql.util.MessageTranslator;
/*
* This class extends java.sql.BatchUpdateException, and provides our
package org.postgresql.jdbc3;
-import java.sql.*;
-import java.util.Vector;
-import java.util.Hashtable;
-import org.postgresql.core.Field;
+import java.sql.SQLException;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc3/Attic/Jdbc3Connection.java,v 1.4 2003/03/07 18:39:45 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc3/Attic/Jdbc3Connection.java,v 1.5 2003/05/29 04:39:50 barry Exp $
* This class implements the java.sql.Connection interface for JDBC3.
* However most of the implementation is really done in
* org.postgresql.jdbc3.AbstractJdbc3Connection or one of it's parents
package org.postgresql.jdbc3;
-import org.postgresql.core.QueryExecutor;
-import org.postgresql.core.Field;
+import org.postgresql.PGRefCursorResultSet;
import org.postgresql.core.BaseStatement;
+import org.postgresql.core.Field;
+import org.postgresql.core.QueryExecutor;
import java.util.Vector;
-import org.postgresql.PGConnection;
-import org.postgresql.PGRefCursorResultSet;
/** A real result set based on a ref cursor.
*
package org.postgresql.test.jdbc2;
import org.postgresql.test.TestUtil;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+
import junit.framework.TestCase;
-import java.io.*;
-import java.sql.*;
/*
* CallableStatement tests.
DatabaseMetaData dbmd = con.getMetaData();
assertNotNull(dbmd);
- assertTrue(dbmd.getDriverVersion().equals(pc.getDriver().getVersion()));
+ assertTrue(dbmd.getDriverVersion().equals(org.postgresql.Driver.getVersion()));
assertTrue(dbmd.getDriverMajorVersion() == pc.getDriver().getMajorVersion());
assertTrue(dbmd.getDriverMinorVersion() == pc.getDriver().getMinorVersion());
*
* PS: Do you know how difficult it is to type on a train? ;-)
*
- * $Id: DatabaseMetaDataTest.java,v 1.17 2003/03/24 03:48:32 barry Exp $
+ * $Id: DatabaseMetaDataTest.java,v 1.18 2003/05/29 04:39:48 barry Exp $
*/
public class DatabaseMetaDataTest extends TestCase
{
DatabaseMetaData dbmd = con.getMetaData();
assertNotNull(dbmd);
- ResultSet rs = dbmd.getBestRowIdentifier(null,null,"pg_type",dbmd.bestRowSession,false);
+ ResultSet rs = dbmd.getBestRowIdentifier(null,null,"pg_type",DatabaseMetaData.bestRowSession,false);
rs.close();
} catch (SQLException sqle) {
fail(sqle.getMessage());
package org.postgresql.test.jdbc2;
import org.postgresql.test.TestUtil;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
import junit.framework.TestCase;
-import java.sql.*;
-import java.math.BigDecimal;
/*
- * $Id: JBuilderTest.java,v 1.7 2002/09/06 21:23:06 momjian Exp $
+ * $Id: JBuilderTest.java,v 1.8 2003/05/29 04:39:48 barry Exp $
*
* Some simple tests to check that the required components needed for JBuilder
* stay working
while (rs.next())
{
- double bd = rs.getDouble(1);
+ rs.getDouble(1);
}
rs.close();
package org.postgresql.test.jdbc2;
import junit.framework.TestSuite;
-import junit.framework.TestCase;
-import junit.framework.Test;
-
-import java.sql.*;
-import java.lang.reflect.Method;
/*
* Executes all known tests for JDBC2 and includes some utility methods.
import java.sql.*;
/*
- * $Id: MiscTest.java,v 1.9 2003/05/29 03:21:32 barry Exp $
+ * $Id: MiscTest.java,v 1.10 2003/05/29 04:39:48 barry Exp $
*
* Some simple tests based on problems reported by users. Hopefully these will
* help prevent previous problems from re-occuring ;-)
while (rs.next())
{
- String s = rs.getString(1);
+ rs.getString(1);
}
rs.close();
package org.postgresql.test.jdbc2;
import org.postgresql.test.TestUtil;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.Types;
+
import junit.framework.TestCase;
-import java.io.*;
-import java.sql.*;
/*
* RefCursor ResultSet tests.
package org.postgresql.test.jdbc2;
import org.postgresql.test.TestUtil;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
import junit.framework.TestCase;
-import java.io.*;
-import java.sql.*;
/*
* ResultSet tests.
package org.postgresql.test.jdbc2;
-import org.postgresql.test.TestUtil;
import org.postgresql.PGStatement;
+import org.postgresql.test.TestUtil;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
import junit.framework.TestCase;
-import java.io.*;
-import java.sql.*;
/*
* Tests for using server side prepared statements
import java.sql.*;
/*
- * $Id: TimestampTest.java,v 1.10 2003/01/14 09:13:51 barry Exp $
+ * $Id: TimestampTest.java,v 1.11 2003/05/29 04:39:48 barry Exp $
*
* Test get/setTimestamp for both timestamp with time zone and
* timestamp without time zone datatypes
protected void setUp() throws Exception
{
con = TestUtil.openDB();
- Statement stmt = con.createStatement();
-
TestUtil.createTable(con, TSWTZ_TABLE, "ts timestamp with time zone");
TestUtil.createTable(con, TSWOTZ_TABLE, "ts timestamp without time zone");
}
package org.postgresql.test.jdbc3;
-import java.sql.Connection;
+import org.postgresql.jdbc3.Jdbc3ConnectionPool;
+import org.postgresql.jdbc3.Jdbc3PooledConnection;
+import org.postgresql.test.TestUtil;
+import org.postgresql.test.jdbc2.optional.ConnectionPoolTest;
import java.sql.SQLException;
+
import javax.sql.PooledConnection;
-import org.postgresql.test.jdbc2.optional.ConnectionPoolTest;
-import org.postgresql.test.TestUtil;
-import org.postgresql.jdbc3.*;
/**
* Tests JDBC3 implementation of ConnectionPoolDataSource.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class Jdbc3ConnectionPoolTest extends ConnectionPoolTest
{
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGtokenizer.java,v 1.6 2003/03/07 18:39:46 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGtokenizer.java,v 1.7 2003/05/29 04:39:51 barry Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.util;
-import java.sql.*;
-import java.util.*;
+import java.util.Vector;
/*
* It's mainly used by the geometric classes, but is useful in parsing any