* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.30 2003/05/29 04:39:51 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.31 2003/06/30 16:38:30 barry Exp $
*
*-------------------------------------------------------------------------
*/
l_urlArgs = url.substring(l_qPos+1);
}
+ // look for an IPv6 address that is enclosed by []
+ // the upcoming parsing that uses colons as identifiers can't handle
+ // the colons in an IPv6 address.
+ int ipv6start = l_urlServer.indexOf("[");
+ int ipv6end = l_urlServer.indexOf("]");
+ String ipv6address = null;
+ if (ipv6start != -1 && ipv6end > ipv6start) {
+ ipv6address = l_urlServer.substring(ipv6start+1,ipv6end);
+ l_urlServer = l_urlServer.substring(0,ipv6start)+"ipv6host"+l_urlServer.substring(ipv6end+1);
+ }
+
//parse the server part of the url
StringTokenizer st = new StringTokenizer(l_urlServer, ":/", true);
for (int count = 0; (st.hasMoreTokens()); count++)
}
}
+ // if we extracted an IPv6 address out earlier put it back
+ if (ipv6address != null)
+ urlProps.put("PGHOST",ipv6address);
+
//parse the args part of the url
StringTokenizer qst = new StringTokenizer(l_urlArgs, "&");
for (int count = 0; (qst.hasMoreTokens()); count++)
postgresql.call.wrongget:Parameter of type {0} was registered but call to get{1} (sqltype={2}) was made.
postgresql.call.noreturnval:A CallableStatement Function was executed with nothing returned.
postgresql.call.wrongrtntype:A CallableStatement Function was executed and the return was of type ({0}) however type={1} was registered.
+postgresql.input.fetch.gt0:Fetch size must be a value greater than or equal to 0.
+postgresql.input.query.gt0:Query Timeout must be a value greater than or equal to 0.
+postgresql.input.rows.gt0:Maximum number of rows must be a value greater than or equal to 0.
import java.sql.Types;
import java.util.Vector;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.24 2003/05/29 04:52:44 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.25 2003/06/30 16:38:30 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
*/
public void setMaxRows(int max) throws SQLException
{
+ if (max<0) throw new PSQLException("postgresql.input.rows.gt0");
maxrows = max;
}
*/
public void setQueryTimeout(int seconds) throws SQLException
{
+ if (seconds<0) throw new PSQLException("postgresql.input.query.gt0");
timeout = seconds;
}
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.19 2003/05/03 20:40:45 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.20 2003/06/30 16:38:30 barry Exp $
*
*-------------------------------------------------------------------------
*/
throw new PSQLException( "postgresql.updateable.notupdateable" );
}
- this_row = (byte[][]) rows.elementAt(current_row);
+ if (current_row < 0) {
+ this_row = null;
+ rowBuffer = null;
+ } else {
+ this_row = (byte[][]) rows.elementAt(current_row);
- rowBuffer = new byte[this_row.length][];
- System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
+ rowBuffer = new byte[this_row.length][];
+ System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
+ }
onInsertRow = false;
doingUpdates = false;
import org.postgresql.largeobject.*;
import org.postgresql.util.PSQLException;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.14 2003/05/29 04:52:44 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.15 2003/06/30 16:38:30 barry Exp $
* This class defines methods of the jdbc2 specification. This class extends
* org.postgresql.jdbc1.AbstractJdbc1Statement which provides the jdbc1
* methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Statement
public void setFetchSize(int rows) throws SQLException
{
+ if (rows<0) throw new PSQLException("postgresql.input.fetch.gt0");
super.fetchSize = rows;
}