mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Added support for JDBC3. The driver will now build under JDBC3 (i.e. Java 1.4).
This concludes my changes that restructured the code to support JDBC3. The jdbc unit tests were also resturctured to allow different tests between jdbc2 and jdbc3, although currently make check (aka ant test) for JDBC3 just runs the JDBC2 tests. Of special note the largeobject/PGblob and PGclob classes have been moved under the jdbc2/jdbc3 specific directories as they now differ by jdbc version. Also note that this checkin removes the PostgresqlDataSource and files in the xa directory. A recent checkin has added new datasource support that replaces the functionality provided by these classes. Modified Files: jdbc/build.xml jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/jdbc2/Array.java jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java jdbc/org/postgresql/jdbc2/Jdbc2Connection.java jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java jdbc/org/postgresql/jdbc2/Jdbc2Statement.java jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java jdbc/org/postgresql/test/jdbc2/BlobTest.java jdbc/org/postgresql/test/jdbc2/CallableStmtTest.java jdbc/org/postgresql/test/jdbc2/ConnectionTest.java jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java jdbc/org/postgresql/test/jdbc2/DateTest.java jdbc/org/postgresql/test/jdbc2/DriverTest.java jdbc/org/postgresql/test/jdbc2/JBuilderTest.java jdbc/org/postgresql/test/jdbc2/MiscTest.java jdbc/org/postgresql/test/jdbc2/ResultSetTest.java jdbc/org/postgresql/test/jdbc2/TimeTest.java jdbc/org/postgresql/test/jdbc2/TimestampTest.java jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java Added Files: jdbc/org/postgresql/jdbc2/AbstractJdbc2Blob.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Clob.java jdbc/org/postgresql/jdbc2/Jdbc2Blob.java jdbc/org/postgresql/jdbc2/Jdbc2Clob.java jdbc/org/postgresql/jdbc3/AbstractJdbc3Blob.java jdbc/org/postgresql/jdbc3/AbstractJdbc3Clob.java jdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java jdbc/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java jdbc/org/postgresql/jdbc3/AbstractJdbc3Statement.java jdbc/org/postgresql/jdbc3/Jdbc3Blob.java jdbc/org/postgresql/jdbc3/Jdbc3CallableStatement.java jdbc/org/postgresql/jdbc3/Jdbc3Clob.java jdbc/org/postgresql/jdbc3/Jdbc3Connection.java jdbc/org/postgresql/jdbc3/Jdbc3DatabaseMetaData.java jdbc/org/postgresql/jdbc3/Jdbc3PreparedStatement.java jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java jdbc/org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java jdbc/org/postgresql/jdbc3/Jdbc3Statement.java jdbc/org/postgresql/test/TestUtil.java jdbc/org/postgresql/test/jdbc2/Jdbc2TestSuite.java jdbc/org/postgresql/test/jdbc3/Jdbc3TestSuite.java Removed Files: jdbc/org/postgresql/PostgresqlDataSource.java jdbc/org/postgresql/largeobject/PGblob.java jdbc/org/postgresql/largeobject/PGclob.java jdbc/org/postgresql/test/JDBC2Tests.java jdbc/org/postgresql/xa/ClientConnection.java jdbc/org/postgresql/xa/TwoPhaseConnection.java jdbc/org/postgresql/xa/TxConnection.java jdbc/org/postgresql/xa/XAConnectionImpl.java jdbc/org/postgresql/xa/XADataSourceImpl.java
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package org.postgresql.test.jdbc2;
|
||||
|
||||
import org.postgresql.test.JDBC2Tests;
|
||||
import org.postgresql.test.TestUtil;
|
||||
import junit.framework.TestCase;
|
||||
import java.sql.*;
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.sql.*;
|
||||
*
|
||||
* PS: Do you know how difficult it is to type on a train? ;-)
|
||||
*
|
||||
* $Id: ConnectionTest.java,v 1.8 2002/07/23 03:59:55 barry Exp $
|
||||
* $Id: ConnectionTest.java,v 1.9 2002/08/14 20:35:40 barry Exp $
|
||||
*/
|
||||
|
||||
public class ConnectionTest extends TestCase
|
||||
@@ -27,23 +27,23 @@ public class ConnectionTest extends TestCase
|
||||
// Set up the fixture for this testcase: the tables for this test.
|
||||
protected void setUp() throws Exception
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
Connection con = TestUtil.openDB();
|
||||
|
||||
JDBC2Tests.createTable(con, "test_a", "imagename name,image oid,id int4");
|
||||
JDBC2Tests.createTable(con, "test_c", "source text,cost money,imageid int4");
|
||||
TestUtil.createTable(con, "test_a", "imagename name,image oid,id int4");
|
||||
TestUtil.createTable(con, "test_c", "source text,cost money,imageid int4");
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
}
|
||||
|
||||
// Tear down the fixture for this test case.
|
||||
protected void tearDown() throws Exception
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
Connection con = TestUtil.openDB();
|
||||
|
||||
JDBC2Tests.dropTable(con, "test_a");
|
||||
JDBC2Tests.dropTable(con, "test_c");
|
||||
TestUtil.dropTable(con, "test_a");
|
||||
TestUtil.dropTable(con, "test_c");
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -53,7 +53,7 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
java.sql.Connection conn = JDBC2Tests.openDB();
|
||||
java.sql.Connection conn = TestUtil.openDB();
|
||||
|
||||
// A standard Statement
|
||||
java.sql.Statement stat = conn.createStatement();
|
||||
@@ -79,7 +79,7 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
java.sql.Connection conn = JDBC2Tests.openDB();
|
||||
java.sql.Connection conn = TestUtil.openDB();
|
||||
|
||||
String sql = "select source,cost,imageid from test_c";
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
java.sql.Connection con = JDBC2Tests.openDB();
|
||||
java.sql.Connection con = TestUtil.openDB();
|
||||
java.sql.Statement st;
|
||||
java.sql.ResultSet rs;
|
||||
|
||||
@@ -155,7 +155,7 @@ public class ConnectionTest extends TestCase
|
||||
assertEquals(9876, rs.getInt(1)); // Should not change!
|
||||
rs.close();
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
@@ -170,12 +170,12 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
Connection con = TestUtil.openDB();
|
||||
|
||||
// Should not say closed
|
||||
assertTrue(!con.isClosed());
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
|
||||
// Should now say closed
|
||||
assertTrue(con.isClosed());
|
||||
@@ -194,7 +194,7 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
Connection con = TestUtil.openDB();
|
||||
|
||||
String testStr = "This Is OuR TeSt message";
|
||||
|
||||
@@ -216,7 +216,7 @@ public class ConnectionTest extends TestCase
|
||||
con.clearWarnings();
|
||||
assertTrue(con.getWarnings() == null);
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
@@ -231,7 +231,7 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
Connection con = TestUtil.openDB();
|
||||
|
||||
// PostgreSQL defaults to READ COMMITTED
|
||||
assertEquals(Connection.TRANSACTION_READ_COMMITTED,
|
||||
@@ -301,7 +301,7 @@ public class ConnectionTest extends TestCase
|
||||
assertEquals(Connection.TRANSACTION_READ_COMMITTED,
|
||||
con.getTransactionIsolation());
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
}
|
||||
catch ( SQLException ex )
|
||||
{
|
||||
@@ -316,7 +316,7 @@ public class ConnectionTest extends TestCase
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
Connection con = TestUtil.openDB();
|
||||
|
||||
// preserve the current map
|
||||
java.util.Map oldmap = con.getTypeMap();
|
||||
@@ -330,7 +330,7 @@ public class ConnectionTest extends TestCase
|
||||
con.setTypeMap(oldmap);
|
||||
assertEquals(oldmap, con.getTypeMap());
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
TestUtil.closeDB(con);
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user