import org.postgresql.util.PGbytea;
import org.postgresql.util.PSQLException;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.3 2002/08/14 20:35:39 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.4 2002/08/16 17:51:38 barry Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2ResultSet which adds the jdbc2
* methods. The real ResultSet class (for jdbc1) is org.postgresql.jdbc1.Jdbc1ResultSet
// If first time, create the buffer, otherwise clear it.
if (rs.sbuf == null)
- rs.sbuf = new StringBuffer();
- else
+ rs.sbuf = new StringBuffer(32);
+ else {
rs.sbuf.setLength(0);
+ }
// Copy s into sbuf for parsing.
rs.sbuf.append(s);
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.3 2002/07/25 22:45:27 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.4 2002/08/16 17:51:38 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
private static final short ESC_TIMEDATE = 3;
// Some performance caches
- private StringBuffer sbuf = new StringBuffer();
+ private StringBuffer sbuf = new StringBuffer(32);
//Used by the preparedstatement style methods
protected String sql;
{
// Since escape codes can only appear in SQL CODE, we keep track
// of if we enter a string or not.
- StringBuffer newsql = new StringBuffer();
+ StringBuffer newsql = new StringBuffer(sql.length());
short state = IN_SQLCODE;
int i = -1;
synchronized (sbuf)
{
sbuf.setLength(0);
+ sbuf.ensureCapacity(x.length());
int i;
sbuf.append('\'');
synchronized (sbuf)
{
sbuf.setLength(0);
+ sbuf.ensureCapacity(32);
sbuf.append("'");
//format the timestamp
//we do our own formating so that we can get a format
/*
* Converts to and from the postgresql bytea datatype used by the backend.
*
- * $Id: PGbytea.java,v 1.4 2002/01/05 22:26:23 barry Exp $
+ * $Id: PGbytea.java,v 1.5 2002/08/16 17:51:38 barry Exp $
*/
public class PGbytea
{
if (p_buf == null)
return null;
- StringBuffer l_strbuf = new StringBuffer();
+ StringBuffer l_strbuf = new StringBuffer(p_buf.length);
for (int i = 0; i < p_buf.length; i++)
{
int l_int = (int)p_buf[i];