Commit f3148bef authored by Bruce Momjian's avatar Bruce Momjian

JDBC indenting, comment cleanups.

parent 8f6f1692
......@@ -6,7 +6,7 @@ import java.util.*;
import org.postgresql.*;
import org.postgresql.util.*;
/**
/*
* org.postgresql.Field is a class used to describe fields in a PostgreSQL
* ResultSet
*/
......@@ -20,7 +20,7 @@ public class Field
private Connection conn; // Connection Instantation
/**
/*
* Construct a field based on the information fed to it.
*
* @param conn the connection this field came from
......@@ -37,7 +37,7 @@ public class Field
this.mod = mod;
}
/**
/*
* Constructor without mod parameter.
*
* @param conn the connection this field came from
......@@ -50,7 +50,7 @@ public class Field
this(conn, name, oid, length, 0);
}
/**
/*
* @return the oid of this Field's data type
*/
public int getOID()
......@@ -58,7 +58,7 @@ public class Field
return oid;
}
/**
/*
* @return the mod of this Field's data type
*/
public int getMod()
......@@ -66,7 +66,7 @@ public class Field
return mod;
}
/**
/*
* @return the name of this Field's data type
*/
public String getName()
......@@ -74,7 +74,7 @@ public class Field
return name;
}
/**
/*
* @return the length of this Field's data type
*/
public int getLength()
......@@ -82,7 +82,7 @@ public class Field
return length;
}
/**
/*
* We also need to get the PG type name as returned by the back end.
*
* @return the String representation of the PG type of this field
......@@ -93,7 +93,7 @@ public class Field
return conn.getPGType(oid);
}
/**
/*
* We also need to get the java.sql.types type.
*
* @return the int representation of the java.sql.types type of this field
......
......@@ -9,8 +9,8 @@ import org.postgresql.*;
import org.postgresql.core.*;
import org.postgresql.util.*;
/**
* $Id: PG_Stream.java,v 1.14 2001/10/25 05:59:59 momjian Exp $
/*
* $Id: PG_Stream.java,v 1.15 2001/11/19 22:33:37 momjian Exp $
*
* This class is used by Connection & PGlobj for communicating with the
* backend.
......@@ -28,7 +28,7 @@ public class PG_Stream
BytePoolDim1 bytePoolDim1 = new BytePoolDim1();
BytePoolDim2 bytePoolDim2 = new BytePoolDim2();
/**
/*
* Constructor: Connect to the PostgreSQL back end and return
* a stream connection.
*
......@@ -49,7 +49,7 @@ public class PG_Stream
pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
}
/**
/*
* Sends a single character to the back end
*
* @param val the character to be sent
......@@ -60,7 +60,7 @@ public class PG_Stream
pg_output.write((byte)val);
}
/**
/*
* Sends an integer to the back end
*
* @param val the integer to be sent
......@@ -79,7 +79,7 @@ public class PG_Stream
Send(buf);
}
/**
/*
* Send an array of bytes to the backend
*
* @param buf The array of bytes to be sent
......@@ -90,7 +90,7 @@ public class PG_Stream
pg_output.write(buf);
}
/**
/*
* Send an exact array of bytes to the backend - if the length
* has not been reached, send nulls until it has.
*
......@@ -103,7 +103,7 @@ public class PG_Stream
Send(buf, 0, siz);
}
/**
/*
* Send an exact array of bytes to the backend - if the length
* has not been reached, send nulls until it has.
*
......@@ -126,7 +126,7 @@ public class PG_Stream
}
}
/**
/*
* Receives a single character from the backend
*
* @return the character received
......@@ -149,7 +149,7 @@ public class PG_Stream
return c;
}
/**
/*
* Receives an integer from the backend
*
* @param siz length of the integer in bytes
......@@ -178,7 +178,7 @@ public class PG_Stream
return n;
}
/**
/*
* Receives an integer from the backend
*
* @param siz length of the integer in bytes
......@@ -207,7 +207,7 @@ public class PG_Stream
return n;
}
/**
/*
* Receives a null-terminated string from the backend. If we don't see a
* null, then we assume something has gone wrong.
*
......@@ -258,7 +258,7 @@ public class PG_Stream
return encoding.decode(rst, 0, s);
}
/**
/*
* Read a tuple from the back end. A tuple is a two dimensional
* array of bytes
*
......@@ -301,7 +301,7 @@ public class PG_Stream
return answer;
}
/**
/*
* Reads in a given number of bytes from the backend
*
* @param siz number of bytes to read
......@@ -315,7 +315,7 @@ public class PG_Stream
return answer;
}
/**
/*
* Reads in a given number of bytes from the backend
*
* @param buf buffer to store result
......@@ -343,7 +343,7 @@ public class PG_Stream
}
}
/**
/*
* This flushes any pending output to the backend. It is used primarily
* by the Fastpath code.
* @exception SQLException if an I/O error occurs
......@@ -360,7 +360,7 @@ public class PG_Stream
}
}
/**
/*
* Closes the connection
*
* @exception IOException if a IO Error occurs
......
/**
/*
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided
* that the following conditions are met:
......@@ -40,7 +40,7 @@
*
* Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
*
* $Id: PostgresqlDataSource.java,v 1.3 2001/10/25 05:59:59 momjian Exp $
* $Id: PostgresqlDataSource.java,v 1.4 2001/11/19 22:33:37 momjian Exp $
*/
......@@ -71,7 +71,7 @@ import org.postgresql.util.PSQLException;
import org.postgresql.xa.XADataSourceImpl;
//---------
/**
/*
* Implements a JDBC 2.0 {@link javax.sql.DataSource} for the
* PostgreSQL driver with JNDI persistance support. XA and pooled
* connection support is also available, but the application must
......@@ -127,45 +127,45 @@ public class PostgresqlDataSource
{
/**
/*
* Holds the timeout for opening a new connection, specified
* in seconds. The default is obtained from the JDBC driver.
*/
private int _loginTimeout;
/**
/*
* Holds the user's account name.
*/
private String _user;
/**
/*
* Holds the database password.
*/
private String _password;
/**
/*
* Holds the name of the particular database on the server.
*/
private String _databaseName;
/**
/*
* Description of this datasource.
*/
private String _description = "PostgreSQL DataSource";
/**
/*
* Holds the database server name. If null, this is
* assumed to be the localhost.
*/
private String _serverName;
/**
/*
* Holds the port number where a server is listening.
* The default value will open a connection with an
* unspecified port.
......@@ -173,7 +173,7 @@ public class PostgresqlDataSource
private int _portNumber = DEFAULT_PORT;
/**
/*
* The default port number. Since we open the connection
* without specifying the port if it's the default one,
* this value can be meaningless.
......@@ -181,7 +181,7 @@ public class PostgresqlDataSource
private static final int DEFAULT_PORT = 0;
/**
/*
* Holds the log writer to which all messages should be
* printed. The default writer is obtained from the driver
* manager, but it can be specified at the datasource level
......@@ -190,7 +190,7 @@ public class PostgresqlDataSource
private transient PrintWriter _logWriter;
/**
/*
* Each datasource maintains it's own driver, in case of
* driver-specific setup (e.g. pools, log writer).
*/
......@@ -335,7 +335,7 @@ public class PostgresqlDataSource
}
/**
/*
* Sets the name of the particular database on the server.
* The standard name for this property is <tt>databaseName</tt>.
*
......@@ -349,7 +349,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns the name of the particular database on the server.
* The standard name for this property is <tt>databaseName</tt>.
*
......@@ -361,7 +361,7 @@ public class PostgresqlDataSource
}
/**
/*
* Sets the description of this datasource.
* The standard name for this property is <tt>description</tt>.
*
......@@ -375,7 +375,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns the description of this datasource.
* The standard name for this property is <tt>description</tt>.
*
......@@ -387,7 +387,7 @@ public class PostgresqlDataSource
}
/**
/*
* Sets the database password.
* The standard name for this property is <tt>password</tt>.
*
......@@ -399,7 +399,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns the database password.
* The standard name for this property is <tt>password</tt>.
*
......@@ -411,7 +411,7 @@ public class PostgresqlDataSource
}
/**
/*
* Sets the port number where a server is listening.
* The standard name for this property is <tt>portNumber</tt>.
*
......@@ -423,7 +423,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns the port number where a server is listening.
* The standard name for this property is <tt>portNumber</tt>.
*
......@@ -435,7 +435,7 @@ public class PostgresqlDataSource
}
/**
/*
* Sets the database server name.
* The standard name for this property is <tt>serverName</tt>.
......@@ -448,7 +448,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns the database server name.
* The standard name for this property is <tt>serverName</tt>.
*
......@@ -460,7 +460,7 @@ public class PostgresqlDataSource
}
/**
/*
* Sets the user's account name.
* The standard name for this property is <tt>user</tt>.
*
......@@ -472,7 +472,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns the user's account name.
* The standard name for this property is <tt>user</tt>.
*
......@@ -484,7 +484,7 @@ public class PostgresqlDataSource
}
/**
/*
* Returns true if this datasource and the other are equal.
* The two datasources are equal if and only if they will produce
* the exact same connections. Connection properties like database
......
......@@ -9,7 +9,7 @@ import java.sql.*;
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/**
/*
* This class implements the common internal methods used by both JDBC 1 and
* JDBC 2 specifications.
*/
......@@ -31,7 +31,7 @@ public abstract class ResultSet
// next resultSet in the chain.
protected ResultSet next = null;
/**
/*
* Create a new ResultSet - Note that we create ResultSets to
* represent the results of everything.
*
......@@ -56,7 +56,7 @@ public abstract class ResultSet
}
/**
/*
* Create a new ResultSet - Note that we create ResultSets to
* represent the results of everything.
*
......@@ -72,7 +72,7 @@ public abstract class ResultSet
this(conn, fields, tuples, status, updateCount, 0, false);
}
/**
/*
* We at times need to know if the resultSet we are working
* with is the result of an UPDATE, DELETE or INSERT (in which
* case, we only have a row count), or of a SELECT operation
......@@ -86,7 +86,7 @@ public abstract class ResultSet
return (fields != null);
}
/**
/*
* Since ResultSets can be chained, we need some method of
* finding the next one in the chain. The method getNext()
* returns the next one in the chain.
......@@ -98,7 +98,7 @@ public abstract class ResultSet
return (java.sql.ResultSet)next;
}
/**
/*
* This following method allows us to add a ResultSet object
* to the end of the current chain.
*
......@@ -112,7 +112,7 @@ public abstract class ResultSet
next.append(r);
}
/**
/*
* If we are just a place holder for results, we still need
* to get an updateCount. This method returns it.
*
......@@ -123,7 +123,7 @@ public abstract class ResultSet
return updateCount;
}
/**
/*
* We also need to provide a couple of auxiliary functions for
* the implementation of the ResultMetaData functions. In
* particular, we need to know the number of rows and the
......@@ -136,7 +136,7 @@ public abstract class ResultSet
return rows.size();
}
/**
/*
* getColumnCount returns the number of columns
*
* @return the number of columns
......@@ -146,7 +146,7 @@ public abstract class ResultSet
return fields.length;
}
/**
/*
* Returns the status message from the backend.<p>
* It is used internally by the driver.
*
......@@ -157,7 +157,7 @@ public abstract class ResultSet
return status;
}
/**
/*
* returns the OID of a field.<p>
* It is used internally by the driver.
*
......@@ -169,7 +169,7 @@ public abstract class ResultSet
return fields[field -1].getOID();
}
/**
/*
* returns the OID of the last inserted row
*/
public int getInsertedOID()
......@@ -177,14 +177,14 @@ public abstract class ResultSet
return insertOID;
}
/**
/*
* This is part of the JDBC API, but is required by org.postgresql.Field
*/
public abstract void close() throws SQLException;
public abstract boolean next() throws SQLException;
public abstract String getString(int i) throws SQLException;
/**
/*
* This is used to fix get*() methods on Money fields. It should only be
* used by those methods!
*
......
......@@ -3,7 +3,7 @@ package org.postgresql;
import java.sql.*;
import org.postgresql.util.PSQLException;
/**
/*
* This class defines methods implemented by the two subclasses
* org.postgresql.jdbc1.Statement and org.postgresql.jdbc2.Statement that are
* unique to PostgreSQL's JDBC driver.
......@@ -49,7 +49,7 @@ public abstract class Statement
public Statement()
{}
/**
/*
* Returns the status message from the current Result.<p>
* This is used internally by the driver.
*
......@@ -62,7 +62,7 @@ public abstract class Statement
return ((org.postgresql.ResultSet) result).getStatusString();
}
/**
/*
* The maxRows limit is set to limit the number of rows that
* any ResultSet can contain. If the limit is exceeded, the
* excess rows are silently dropped.
......@@ -75,7 +75,7 @@ public abstract class Statement
return maxrows;
}
/**
/*
* Set the maximum number of rows
*
* @param max the new max rows limit; zero means unlimited
......@@ -87,7 +87,7 @@ public abstract class Statement
maxrows = max;
}
/**
/*
* If escape scanning is on (the default), the driver will do escape
* substitution before sending the SQL to the database.
*
......@@ -99,7 +99,7 @@ public abstract class Statement
escapeProcessing = enable;
}
/**
/*
* The queryTimeout limit is the number of seconds the driver
* will wait for a Statement to execute. If the limit is
* exceeded, a SQLException is thrown.
......@@ -112,7 +112,7 @@ public abstract class Statement
return timeout;
}
/**
/*
* Sets the queryTimeout limit
*
* @param seconds - the new query timeout limit in seconds
......@@ -123,7 +123,7 @@ public abstract class Statement
timeout = seconds;
}
/**
/*
* The first warning reported by calls on this Statement is
* returned. A Statement's execute methods clear its SQLWarning
* chain. Subsequent Statement warnings will be chained to this
......@@ -144,7 +144,7 @@ public abstract class Statement
return warnings;
}
/**
/*
* The maxFieldSize limit (in bytes) is the maximum amount of
* data returned for any column value; it only applies to
* BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR
......@@ -159,7 +159,7 @@ public abstract class Statement
return 8192; // We cannot change this
}
/**
/*
* Sets the maxFieldSize - NOT! - We throw an SQLException just
* to inform them to stop doing this.
*
......@@ -171,7 +171,7 @@ public abstract class Statement
throw new PSQLException("postgresql.stat.maxfieldsize");
}
/**
/*
* After this call, getWarnings returns null until a new warning
* is reported for this Statement.
*
......@@ -182,7 +182,7 @@ public abstract class Statement
warnings = null;
}
/**
/*
* Cancel can be used by one thread to cancel a statement that
* is being executed by another thread.
* <p>
......@@ -195,7 +195,7 @@ public abstract class Statement
// FIXME: Cancel feature has been available since 6.4. Implement it here!
}
/**
/*
* New in 7.1: Returns the Last inserted oid. This should be used, rather
* than the old method using getResultSet, which for executeUpdate returns
* null.
......@@ -208,7 +208,7 @@ public abstract class Statement
return ((org.postgresql.ResultSet) result).getInsertedOID();
}
/**
/*
* getResultSet returns the current result as a ResultSet. It
* should only be called once per result.
*
......@@ -222,7 +222,7 @@ public abstract class Statement
return null;
}
/**
/*
* In many cases, it is desirable to immediately release a
* Statement's database and JDBC resources instead of waiting
* for this to happen when it is automatically closed. The
......@@ -245,7 +245,7 @@ public abstract class Statement
result = null;
}
/**
/*
* Filter the SQL string of Java SQL Escape clauses.
*
* Currently implemented Escape clauses are those mentioned in 11.3
......
package org.postgresql.core;
/**
/*
* A simple and efficient class to pool one dimensional byte arrays
* of different sizes.
*/
public class BytePoolDim1
{
/**
/*
* The maximum size of the array we manage.
*/
int maxsize = 256;
/**
/*
* The pools not currently in use
*/
ObjectPool notusemap[] = new ObjectPool[maxsize + 1];
/**
/*
* The pools currently in use
*/
ObjectPool inusemap[] = new ObjectPool[maxsize + 1];
/**
/*
*
*/
byte binit[][] = new byte[maxsize + 1][0];
/**
/*
* Construct a new pool
*/
public BytePoolDim1()
......@@ -37,7 +37,7 @@ public class BytePoolDim1
}
}
/**
/*
* Allocate a byte[] of a specified size and put it in the pool. If it's
* larger than maxsize then it is not pooled.
* @return the byte[] allocated
......@@ -48,7 +48,7 @@ public class BytePoolDim1
return new byte[size];
/*
// Don't pool if >maxsize
if(size > maxsize){
if (size > maxsize){
return new byte[size];
}
......@@ -58,7 +58,7 @@ public class BytePoolDim1
// Fetch from the unused pool if available otherwise allocate a new
// now array
if(!not_usel.isEmpty()) {
if (!not_usel.isEmpty()) {
Object o = not_usel.remove();
b = (byte[]) o;
} else
......@@ -69,7 +69,7 @@ public class BytePoolDim1
*/
}
/**
/*
* Release an array
* @param b byte[] to release
*/
......@@ -86,7 +86,7 @@ public class BytePoolDim1
not_usel.add(b);
}
/**
/*
* Deallocate all
* @deprecated Real bad things happen if this is called!
*/
......
......@@ -20,7 +20,7 @@ public class BytePoolDim2
// For now until the bug can be removed
return new byte[size][0];
/*
if(size > maxsize){
if (size > maxsize){
return new byte[size][0];
}
ObjectPool not_usel = notusemap[size];
......@@ -28,7 +28,7 @@ public class BytePoolDim2
byte b[][] = null;
if(!not_usel.isEmpty()) {
if (!not_usel.isEmpty()) {
Object o = not_usel.remove();
b = (byte[][]) o;
} else
......@@ -51,7 +51,7 @@ public class BytePoolDim2
not_usel.add(b);
}
/**
/*
* Deallocate the object cache.
* PM 17/01/01: Commented out this code as it blows away any hope of
* multiple queries on the same connection. I'll redesign the allocation
......
......@@ -5,10 +5,10 @@ import java.util.*;
import java.sql.SQLException;
import org.postgresql.util.*;
/**
/*
* Converts to and from the character encoding used by the backend.
*
* $Id: Encoding.java,v 1.3 2001/10/25 05:59:59 momjian Exp $
* $Id: Encoding.java,v 1.4 2001/11/19 22:33:37 momjian Exp $
*/
public class Encoding
......@@ -16,7 +16,7 @@ public class Encoding
private static final Encoding DEFAULT_ENCODING = new Encoding(null);
/**
/*
* Preferred JVM encodings for backend encodings.
*/
private static final Hashtable encodings = new Hashtable();
......@@ -65,7 +65,7 @@ public class Encoding
this.encoding = encoding;
}
/**
/*
* Get an Encoding for from the given database encoding and
* the encoding passed in by the user.
*/
......@@ -89,7 +89,7 @@ public class Encoding
}
}
/**
/*
* Get an Encoding matching the given database encoding.
*/
private static Encoding encodingForDatabaseEncoding(String databaseEncoding)
......@@ -112,7 +112,7 @@ public class Encoding
return defaultEncoding();
}
/**
/*
* Name of the (JVM) encoding used.
*/
public String name()
......@@ -120,7 +120,7 @@ public class Encoding
return encoding;
}
/**
/*
* Encode a string to an array of bytes.
*/
public byte[] encode(String s) throws SQLException
......@@ -142,7 +142,7 @@ public class Encoding
}
}
/**
/*
* Decode an array of bytes into a string.
*/
public String decode(byte[] encodedString, int offset, int length) throws SQLException
......@@ -164,7 +164,7 @@ public class Encoding
}
}
/**
/*
* Decode an array of bytes into a string.
*/
public String decode(byte[] encodedString) throws SQLException
......@@ -172,7 +172,7 @@ public class Encoding
return decode(encodedString, 0, encodedString.length);
}
/**
/*
* Get a Reader that decodes the given InputStream.
*/
public Reader getDecodingReader(InputStream in) throws SQLException
......@@ -194,7 +194,7 @@ public class Encoding
}
}
/**
/*
* Get an Encoding using the default encoding for the JVM.
*/
public static Encoding defaultEncoding()
......@@ -202,7 +202,7 @@ public class Encoding
return DEFAULT_ENCODING;
}
/**
/*
* Test if an encoding is available in the JVM.
*/
private static boolean isAvailable(String encodingName)
......
package org.postgresql.core;
/**
/*
* This interface defines the methods to access the memory pool classes.
*/
public interface MemoryPool
{
/**
/*
* Allocate an array from the pool
* @return byte[] allocated
*/
public byte[] allocByte(int size);
/**
/*
* Frees an object back to the pool
* @param o Object to release
*/
......
package org.postgresql.core;
/**
/*
* This interface defines methods needed to implement a simple object pool.
* There are two known classes that implement this, one for jdk1.1 and the
* other for jdk1.2+
......@@ -8,41 +8,41 @@ package org.postgresql.core;
public interface ObjectPool
{
/**
/*
* Adds an object to the pool
* @param o Object to add
*/
public void add(Object o);
/**
/*
* Removes an object from the pool
* @param o Object to remove
*/
public void remove(Object o);
/**
/*
* Removes the top object from the pool
* @return Object from the top.
*/
public Object remove();
/**
/*
* @return true if the pool is empty
*/
public boolean isEmpty();
/**
/*
* @return the number of objects in the pool
*/
public int size();
/**
/*
* Adds all objects in one pool to this one
* @param pool The pool to take the objects from
*/
public void addAll(ObjectPool pool);
/**
/*
* Clears the pool of all objects
*/
public void clear();
......
......@@ -7,13 +7,13 @@ import java.sql.*;
import org.postgresql.*;
import org.postgresql.util.PSQLException;
/**
/*
* Executes a query on the backend.
*
* <p>The lifetime of a QueryExecutor object is from sending the query
* until the response has been received from the backend.
*
* $Id: QueryExecutor.java,v 1.3 2001/10/25 05:59:59 momjian Exp $
* $Id: QueryExecutor.java,v 1.4 2001/11/19 22:33:37 momjian Exp $
*/
public class QueryExecutor
......@@ -49,7 +49,7 @@ public class QueryExecutor
private int insert_oid = 0;
private int maxRows;
/**
/*
* Execute a query on the backend.
*/
public java.sql.ResultSet execute() throws SQLException
......@@ -122,7 +122,7 @@ public class QueryExecutor
}
}
/**
/*
* Send a query to the backend.
*/
private void sendQuery(String query) throws SQLException
......@@ -141,7 +141,7 @@ public class QueryExecutor
}
}
/**
/*
* Receive a tuple from the backend.
*
* @param isBinary set if the tuple should be treated as binary data
......@@ -157,7 +157,7 @@ public class QueryExecutor
tuples.addElement(tuple);
}
/**
/*
* Receive command status from the backend.
*/
private void receiveCommandStatus() throws SQLException
......@@ -184,7 +184,7 @@ public class QueryExecutor
}
}
/**
/*
* Receive the field descriptions from the back end.
*/
private void receiveFields() throws SQLException
......
package org.postgresql.core;
/**
/*
* A simple and fast object pool implementation that can pool objects
* of any type. This implementation is not thread safe, it is up to the users
* of this class to assure thread safety.
......@@ -15,7 +15,7 @@ public class SimpleObjectPool implements ObjectPool
int maxsize = 16;
Object arr[] = new Object[maxsize];
/**
/*
* Adds an object to the pool
* @param o Object to add
*/
......@@ -31,7 +31,7 @@ public class SimpleObjectPool implements ObjectPool
arr[cursize++] = o;
}
/**
/*
* Removes the top object from the pool
* @return Object from the top.
*/
......@@ -40,7 +40,7 @@ public class SimpleObjectPool implements ObjectPool
return arr[--cursize];
}
/**
/*
* Removes the given object from the pool
* @param o Object to remove
*/
......@@ -57,7 +57,7 @@ public class SimpleObjectPool implements ObjectPool
}
}
/**
/*
* @return true if the pool is empty
*/
public boolean isEmpty()
......@@ -65,7 +65,7 @@ public class SimpleObjectPool implements ObjectPool
return cursize == 0;
}
/**
/*
* @return the number of objects in the pool
*/
public int size()
......@@ -73,7 +73,7 @@ public class SimpleObjectPool implements ObjectPool
return cursize;
}
/**
/*
* Adds all objects in one pool to this one
* @param pool The pool to take the objects from
*/
......@@ -96,7 +96,7 @@ public class SimpleObjectPool implements ObjectPool
cursize = totalsize;
}
/**
/*
* Clears the pool of all objects
*/
public void clear()
......
......@@ -10,7 +10,7 @@ import org.postgresql.util.*;
// Important: There are a lot of debug code commented out. Please do not
// delete these.
/**
/*
* This class implements the Fastpath api.
*
* <p>This is a means of executing functions imbeded in the org.postgresql backend
......@@ -30,7 +30,7 @@ public class Fastpath
protected org.postgresql.Connection conn; // our connection
protected org.postgresql.PG_Stream stream; // the network stream
/**
/*
* Initialises the fastpath system
*
* <p><b>Important Notice</b>
......@@ -47,7 +47,7 @@ public class Fastpath
//DriverManager.println("Fastpath initialised");
}
/**
/*
* Send a function call to the PostgreSQL backend
*
* @param fnid Function id
......@@ -91,8 +91,8 @@ public class Fastpath
// as an error.
//int in = stream.ReceiveChar();
//DriverManager.println("ReceiveChar() = "+in+" '"+((char)in)+"'");
//if(in!='V') {
//if(in=='E')
//if (in!='V') {
//if (in=='E')
//throw new SQLException(stream.ReceiveString(conn.getEncoding()));
//throw new SQLException("Fastpath: expected 'V' from backend, got "+((char)in));
//}
......@@ -156,7 +156,7 @@ public class Fastpath
}
}
/**
/*
* Send a function call to the PostgreSQL backend by name.
*
* Note: the mapping for the procedure name to function id needs to exist,
......@@ -182,7 +182,7 @@ public class Fastpath
return fastpath(getID(name), resulttype, args);
}
/**
/*
* This convenience method assumes that the return value is an Integer
* @param name Function name
* @param args Function arguments
......@@ -197,7 +197,7 @@ public class Fastpath
return i.intValue();
}
/**
/*
* This convenience method assumes that the return value is an Integer
* @param name Function name
* @param args Function arguments
......@@ -209,7 +209,7 @@ public class Fastpath
return (byte[])fastpath(name, false, args);
}
/**
/*
* This adds a function to our lookup table.
*
* <p>User code should use the addFunctions method, which is based upon a
......@@ -225,7 +225,7 @@ public class Fastpath
func.put(name, new Integer(fnid));
}
/**
/*
* This takes a ResultSet containing two columns. Column 1 contains the
* function name, Column 2 the oid.
*
......@@ -265,7 +265,7 @@ public class Fastpath
}
}
/**
/*
* This returns the function id associated by its name
*
* <p>If addFunction() or addFunctions() have not been called for this name,
......
......@@ -7,7 +7,7 @@ import java.util.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* Each fastpath call requires an array of arguments, the number and type
* dependent on the function being called.
*
......@@ -22,22 +22,22 @@ import org.postgresql.util.*;
*/
public class FastpathArg
{
/**
/*
* Type of argument, true=integer, false=byte[]
*/
public boolean type;
/**
/*
* Integer value if type=true
*/
public int value;
/**
/*
* Byte value if type=false;
*/
public byte[] bytes;
/**
/*
* Constructs an argument that consists of an integer value
* @param value int value to set
*/
......@@ -47,7 +47,7 @@ public class FastpathArg
this.value = value;
}
/**
/*
* Constructs an argument that consists of an array of bytes
* @param bytes array to store
*/
......@@ -57,7 +57,7 @@ public class FastpathArg
this.bytes = bytes;
}
/**
/*
* Constructs an argument that consists of part of a byte array
* @param buf source array
* @param off offset within array
......@@ -70,7 +70,7 @@ public class FastpathArg
System.arraycopy(buf, off, bytes, 0, len);
}
/**
/*
* Constructs an argument that consists of a String.
* @param s String to store
*/
......@@ -79,7 +79,7 @@ public class FastpathArg
this(s.getBytes());
}
/**
/*
* This sends this argument down the network stream.
*
* <p>The stream sent consists of the length.int4 then the contents.
......
......@@ -4,17 +4,17 @@ import java.io.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This represents the box datatype within org.postgresql.
*/
public class PGbox extends PGobject implements Serializable, Cloneable
{
/**
/*
* These are the two points.
*/
public PGpoint point[] = new PGpoint[2];
/**
/*
* @param x1 first x coordinate
* @param y1 first y coordinate
* @param x2 second x coordinate
......@@ -27,7 +27,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
this.point[1] = new PGpoint(x2, y2);
}
/**
/*
* @param p1 first point
* @param p2 second point
*/
......@@ -38,7 +38,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
this.point[1] = p2;
}
/**
/*
* @param s Box definition in PostgreSQL syntax
* @exception SQLException if definition is invalid
*/
......@@ -48,7 +48,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
setValue(s);
}
/**
/*
* Required constructor
*/
public PGbox()
......@@ -56,7 +56,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
setType("box");
}
/**
/*
* This method sets the value of this object. It should be overidden,
* but still called by subclasses.
*
......@@ -73,7 +73,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
point[1] = new PGpoint(t.getToken(1));
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -88,7 +88,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -96,7 +96,7 @@ public class PGbox extends PGobject implements Serializable, Cloneable
return new PGbox((PGpoint)point[0].clone(), (PGpoint)point[1].clone());
}
/**
/*
* @return the PGbox in the syntax expected by org.postgresql
*/
public String getValue()
......
......@@ -4,23 +4,23 @@ import java.io.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This represents org.postgresql's circle datatype, consisting of a point and
* a radius
*/
public class PGcircle extends PGobject implements Serializable, Cloneable
{
/**
/*
* This is the centre point
*/
public PGpoint center;
/**
/*
* This is the radius
*/
double radius;
/**
/*
* @param x coordinate of centre
* @param y coordinate of centre
* @param r radius of circle
......@@ -30,7 +30,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
this(new PGpoint(x, y), r);
}
/**
/*
* @param c PGpoint describing the circle's centre
* @param r radius of circle
*/
......@@ -41,7 +41,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
this.radius = r;
}
/**
/*
* @param s definition of the circle in PostgreSQL's syntax.
* @exception SQLException on conversion failure
*/
......@@ -51,7 +51,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
setValue(s);
}
/**
/*
* This constructor is used by the driver.
*/
public PGcircle()
......@@ -59,7 +59,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
setType("circle");
}
/**
/*
* @param s definition of the circle in PostgreSQL's syntax.
* @exception SQLException on conversion failure
*/
......@@ -80,7 +80,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
}
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -94,7 +94,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -102,7 +102,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable
return new PGcircle((PGpoint)center.clone(), radius);
}
/**
/*
* @return the PGcircle in the syntax expected by org.postgresql
*/
public String getValue()
......
......@@ -4,7 +4,7 @@ import java.io.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This implements a line consisting of two points.
*
* Currently line is not yet implemented in the backend, but this class
......@@ -12,12 +12,12 @@ import org.postgresql.util.*;
*/
public class PGline extends PGobject implements Serializable, Cloneable
{
/**
/*
* These are the two points.
*/
public PGpoint point[] = new PGpoint[2];
/**
/*
* @param x1 coordinate for first point
* @param y1 coordinate for first point
* @param x2 coordinate for second point
......@@ -28,7 +28,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
this(new PGpoint(x1, y1), new PGpoint(x2, y2));
}
/**
/*
* @param p1 first point
* @param p2 second point
*/
......@@ -39,7 +39,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
this.point[1] = p2;
}
/**
/*
* @param s definition of the circle in PostgreSQL's syntax.
* @exception SQLException on conversion failure
*/
......@@ -49,7 +49,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
setValue(s);
}
/**
/*
* reuired by the driver
*/
public PGline()
......@@ -57,7 +57,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
setType("line");
}
/**
/*
* @param s Definition of the line segment in PostgreSQL's syntax
* @exception SQLException on conversion failure
*/
......@@ -71,7 +71,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
point[1] = new PGpoint(t.getToken(1));
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -86,7 +86,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -94,7 +94,7 @@ public class PGline extends PGobject implements Serializable, Cloneable
return new PGline((PGpoint)point[0].clone(), (PGpoint)point[1].clone());
}
/**
/*
* @return the PGline in the syntax expected by org.postgresql
*/
public String getValue()
......
......@@ -4,17 +4,17 @@ import java.io.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This implements a lseg (line segment) consisting of two points
*/
public class PGlseg extends PGobject implements Serializable, Cloneable
{
/**
/*
* These are the two points.
*/
public PGpoint point[] = new PGpoint[2];
/**
/*
* @param x1 coordinate for first point
* @param y1 coordinate for first point
* @param x2 coordinate for second point
......@@ -25,7 +25,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
this(new PGpoint(x1, y1), new PGpoint(x2, y2));
}
/**
/*
* @param p1 first point
* @param p2 second point
*/
......@@ -36,7 +36,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
this.point[1] = p2;
}
/**
/*
* @param s definition of the circle in PostgreSQL's syntax.
* @exception SQLException on conversion failure
*/
......@@ -46,7 +46,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
setValue(s);
}
/**
/*
* reuired by the driver
*/
public PGlseg()
......@@ -54,7 +54,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
setType("lseg");
}
/**
/*
* @param s Definition of the line segment in PostgreSQL's syntax
* @exception SQLException on conversion failure
*/
......@@ -68,7 +68,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
point[1] = new PGpoint(t.getToken(1));
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -83,7 +83,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -91,7 +91,7 @@ public class PGlseg extends PGobject implements Serializable, Cloneable
return new PGlseg((PGpoint)point[0].clone(), (PGpoint)point[1].clone());
}
/**
/*
* @return the PGlseg in the syntax expected by org.postgresql
*/
public String getValue()
......
......@@ -4,22 +4,22 @@ import java.io.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This implements a path (a multiple segmented line, which may be closed)
*/
public class PGpath extends PGobject implements Serializable, Cloneable
{
/**
/*
* True if the path is open, false if closed
*/
public boolean open;
/**
/*
* The points defining this path
*/
public PGpoint points[];
/**
/*
* @param points the PGpoints that define the path
* @param open True if the path is open, false if closed
*/
......@@ -30,7 +30,7 @@ public class PGpath extends PGobject implements Serializable, Cloneable
this.open = open;
}
/**
/*
* Required by the driver
*/
public PGpath()
......@@ -38,7 +38,7 @@ public class PGpath extends PGobject implements Serializable, Cloneable
setType("path");
}
/**
/*
* @param s definition of the circle in PostgreSQL's syntax.
* @exception SQLException on conversion failure
*/
......@@ -48,7 +48,7 @@ public class PGpath extends PGobject implements Serializable, Cloneable
setValue(s);
}
/**
/*
* @param s Definition of the path in PostgreSQL's syntax
* @exception SQLException on conversion failure
*/
......@@ -75,7 +75,7 @@ public class PGpath extends PGobject implements Serializable, Cloneable
points[p] = new PGpoint(t.getToken(p));
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -100,7 +100,7 @@ public class PGpath extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -111,7 +111,7 @@ public class PGpath extends PGobject implements Serializable, Cloneable
return new PGpath(ary, open);
}
/**
/*
* This returns the polygon in the syntax expected by org.postgresql
*/
public String getValue()
......
......@@ -6,7 +6,7 @@ import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This implements a version of java.awt.Point, except it uses double
* to represent the coordinates.
*
......@@ -14,17 +14,17 @@ import org.postgresql.util.*;
*/
public class PGpoint extends PGobject implements Serializable, Cloneable
{
/**
/*
* The X coordinate of the point
*/
public double x;
/**
/*
* The Y coordinate of the point
*/
public double y;
/**
/*
* @param x coordinate
* @param y coordinate
*/
......@@ -35,7 +35,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
this.y = y;
}
/**
/*
* This is called mainly from the other geometric types, when a
* point is imbeded within their definition.
*
......@@ -47,7 +47,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
setValue(value);
}
/**
/*
* Required by the driver
*/
public PGpoint()
......@@ -55,7 +55,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
setType("point");
}
/**
/*
* @param s Definition of this point in PostgreSQL's syntax
* @exception SQLException on conversion failure
*/
......@@ -73,7 +73,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
}
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -87,7 +87,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -95,7 +95,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
return new PGpoint(x, y);
}
/**
/*
* @return the PGpoint in the syntax expected by org.postgresql
*/
public String getValue()
......@@ -103,7 +103,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
return "(" + x + "," + y + ")";
}
/**
/*
* Translate the point with the supplied amount.
* @param x integer amount to add on the x axis
* @param y integer amount to add on the y axis
......@@ -113,7 +113,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
translate((double)x, (double)y);
}
/**
/*
* Translate the point with the supplied amount.
* @param x double amount to add on the x axis
* @param y double amount to add on the y axis
......@@ -124,7 +124,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
this.y += y;
}
/**
/*
* Moves the point to the supplied coordinates.
* @param x integer coordinate
* @param y integer coordinate
......@@ -134,7 +134,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
setLocation(x, y);
}
/**
/*
* Moves the point to the supplied coordinates.
* @param x double coordinate
* @param y double coordinate
......@@ -145,7 +145,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
this.y = y;
}
/**
/*
* Moves the point to the supplied coordinates.
* refer to java.awt.Point for description of this
* @param x integer coordinate
......@@ -157,7 +157,7 @@ public class PGpoint extends PGobject implements Serializable, Cloneable
move((double)x, (double)y);
}
/**
/*
* Moves the point to the supplied java.awt.Point
* refer to java.awt.Point for description of this
* @param p Point to move to
......
......@@ -4,17 +4,17 @@ import java.io.*;
import java.sql.*;
import org.postgresql.util.*;
/**
/*
* This implements the polygon datatype within PostgreSQL.
*/
public class PGpolygon extends PGobject implements Serializable, Cloneable
{
/**
/*
* The points defining the polygon
*/
public PGpoint points[];
/**
/*
* Creates a polygon using an array of PGpoints
*
* @param points the points defining the polygon
......@@ -25,7 +25,7 @@ public class PGpolygon extends PGobject implements Serializable, Cloneable
this.points = points;
}
/**
/*
* @param s definition of the circle in PostgreSQL's syntax.
* @exception SQLException on conversion failure
*/
......@@ -35,7 +35,7 @@ public class PGpolygon extends PGobject implements Serializable, Cloneable
setValue(s);
}
/**
/*
* Required by the driver
*/
public PGpolygon()
......@@ -43,7 +43,7 @@ public class PGpolygon extends PGobject implements Serializable, Cloneable
setType("polygon");
}
/**
/*
* @param s Definition of the polygon in PostgreSQL's syntax
* @exception SQLException on conversion failure
*/
......@@ -56,7 +56,7 @@ public class PGpolygon extends PGobject implements Serializable, Cloneable
points[p] = new PGpoint(t.getToken(p));
}
/**
/*
* @param obj Object to compare with
* @return true if the two boxes are identical
*/
......@@ -78,7 +78,7 @@ public class PGpolygon extends PGobject implements Serializable, Cloneable
return false;
}
/**
/*
* This must be overidden to allow the object to be cloned
*/
public Object clone()
......@@ -89,7 +89,7 @@ public class PGpolygon extends PGobject implements Serializable, Cloneable
return new PGpolygon(ary);
}
/**
/*
* @return the PGpolygon in the syntax expected by org.postgresql
*/
public String getValue()
......
......@@ -8,7 +8,7 @@ package org.postgresql.jdbc1;
import java.sql.*;
import java.math.*;
/**
/*
* CallableStatement is used to execute SQL stored procedures.
*
* <p>JDBC provides a stored procedure SQL escape that allows stored
......@@ -41,7 +41,7 @@ import java.math.*;
public class CallableStatement extends PreparedStatement implements java.sql.CallableStatement
{
/**
/*
* @exception SQLException on failure
*/
CallableStatement(Connection c, String q) throws SQLException
......@@ -49,7 +49,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
super(c, q);
}
/**
/*
* Before executing a stored procedure call you must explicitly
* call registerOutParameter to register the java.sql.Type of each
* out parameter.
......@@ -67,7 +67,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
{}
/**
/*
* You must also specify the scale for numeric/decimal types:
*
* <p>Note: When reading the value of an out parameter, you must use
......@@ -89,7 +89,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
//return true;
//}
/**
/*
* An OUT parameter may have the value of SQL NULL; wasNull
* reports whether the last value read has this special value.
*
......@@ -109,7 +109,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
//return null;
//}
/**
/*
* Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a
* Java String.
*
......@@ -129,7 +129,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
//return null;
//}
/**
/*
* Get the value of a BIT parameter as a Java boolean.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -141,7 +141,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return false;
}
/**
/*
* Get the value of a TINYINT parameter as a Java byte.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -153,7 +153,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return 0;
}
/**
/*
* Get the value of a SMALLINT parameter as a Java short.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -165,7 +165,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return 0;
}
/**
/*
* Get the value of an INTEGER parameter as a Java int.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -177,7 +177,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return 0;
}
/**
/*
* Get the value of a BIGINT parameter as a Java long.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -189,7 +189,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return 0;
}
/**
/*
* Get the value of a FLOAT parameter as a Java float.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -201,7 +201,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return (float) 0.0;
}
/**
/*
* Get the value of a DOUBLE parameter as a Java double.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -213,7 +213,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return 0.0;
}
/**
/*
* Get the value of a NUMERIC parameter as a java.math.BigDecimal
* object.
*
......@@ -229,7 +229,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return null;
}
/**
/*
* Get the value of a SQL BINARY or VARBINARY parameter as a Java
* byte[]
*
......@@ -247,7 +247,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
//return null;
//}
/**
/*
* Get the value of a SQL DATE parameter as a java.sql.Date object
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -259,7 +259,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return null;
}
/**
/*
* Get the value of a SQL TIME parameter as a java.sql.Time object.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -271,7 +271,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
return null;
}
/**
/*
* Get the value of a SQL TIMESTAMP parameter as a java.sql.Timestamp object.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -295,7 +295,7 @@ public class CallableStatement extends PreparedStatement implements java.sql.Cal
// getObject returns a Java object for the parameter.
// See the JDBC spec's "Dynamic Programming" chapter for details.
/**
/*
* Get the value of a parameter as a Java object.
*
* <p>This method returns a Java object whose type coresponds to the
......
......@@ -16,8 +16,8 @@ import org.postgresql.fastpath.*;
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/**
* $Id: Connection.java,v 1.12 2001/10/25 05:59:59 momjian Exp $
/*
* $Id: Connection.java,v 1.13 2001/11/19 22:33:38 momjian Exp $
*
* A Connection represents a session with a specific database. Within the
* context of a Connection, SQL statements are executed and results are
......@@ -39,7 +39,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
// This is a cache of the DatabaseMetaData instance for this connection
protected DatabaseMetaData metadata;
/**
/*
* SQL statements without parameters are normally executed using
* Statement objects. If the same SQL statement is executed many
* times, it is more efficient to use a PreparedStatement
......@@ -52,7 +52,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return new Statement(this);
}
/**
/*
* A SQL statement with or without IN parameters can be pre-compiled
* and stored in a PreparedStatement object. This object can then
* be used to efficiently execute this statement multiple times.
......@@ -75,7 +75,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return new PreparedStatement(this, sql);
}
/**
/*
* A SQL stored procedure call statement is handled by creating a
* CallableStatement for it. The CallableStatement provides methods
* for setting up its IN and OUT parameters and methods for executing
......@@ -100,7 +100,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
// return new CallableStatement(this, sql);
}
/**
/*
* Tests to see if a Connection is closed
*
* @return the status of the connection
......@@ -111,7 +111,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return (pg_stream == null);
}
/**
/*
* A connection's database is able to provide information describing
* its tables, its supported SQL grammar, its stored procedures, the
* capabilities of this connection, etc. This information is made
......@@ -127,7 +127,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return metadata;
}
/**
/*
* This overides the method in org.postgresql.Connection and returns a
* ResultSet.
*/
......@@ -157,7 +157,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return sqlType;
}
/**
/*
* 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.
* They default automatically to Types.OTHER
......@@ -183,7 +183,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
"abstime", "timestamp"
};
/**
/*
* This table holds the JDBC type for each entry above.
*
* Note: This must be in the same order as above
......
......@@ -13,7 +13,7 @@ import java.util.*;
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/**
/*
* A SQL Statement is pre-compiled and stored in a PreparedStatement object.
* This object can then be used to efficiently execute this statement multiple
* times.
......@@ -36,7 +36,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
String[] inStrings;
Connection connection;
/**
/*
* Constructor for the PreparedStatement class.
* Split the SQL statement into segments - separated by the arguments.
* When we rebuild the thing with the arguments, we can substitute the
......@@ -78,7 +78,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
templateStrings[i] = (String)v.elementAt(i);
}
/**
/*
* A Prepared SQL query is executed and its ResultSet is returned
*
* @return a ResultSet that contains the data produced by the
......@@ -101,7 +101,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
return super.executeQuery(s.toString()); // in Statement class
}
/**
/*
* Execute a SQL INSERT, UPDATE or DELETE statement. In addition,
* SQL statements that return nothing such as SQL DDL statements can
* be executed.
......@@ -126,7 +126,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
return super.executeUpdate(s.toString()); // in Statement class
}
/**
/*
* Set a parameter to SQL NULL
*
* <p><B>Note:</B> You must specify the parameters SQL type (although
......@@ -141,7 +141,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, "null");
}
/**
/*
* Set a parameter to a Java boolean value. The driver converts this
* to a SQL BIT value when it sends it to the database.
*
......@@ -154,7 +154,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, x ? "'t'" : "'f'");
}
/**
/*
* Set a parameter to a Java byte value. The driver converts this to
* a SQL TINYINT value when it sends it to the database.
*
......@@ -167,7 +167,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, Integer.toString(x));
}
/**
/*
* Set a parameter to a Java short value. The driver converts this
* to a SQL SMALLINT value when it sends it to the database.
*
......@@ -180,7 +180,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, Integer.toString(x));
}
/**
/*
* Set a parameter to a Java int value. The driver converts this to
* a SQL INTEGER value when it sends it to the database.
*
......@@ -193,7 +193,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, Integer.toString(x));
}
/**
/*
* Set a parameter to a Java long value. The driver converts this to
* a SQL BIGINT value when it sends it to the database.
*
......@@ -206,7 +206,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, Long.toString(x));
}
/**
/*
* Set a parameter to a Java float value. The driver converts this
* to a SQL FLOAT value when it sends it to the database.
*
......@@ -219,7 +219,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, Float.toString(x));
}
/**
/*
* Set a parameter to a Java double value. The driver converts this
* to a SQL DOUBLE value when it sends it to the database
*
......@@ -232,7 +232,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, Double.toString(x));
}
/**
/*
* Set a parameter to a java.lang.BigDecimal value. The driver
* converts this to a SQL NUMERIC value when it sends it to the
* database.
......@@ -246,7 +246,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
set(parameterIndex, x.toString());
}
/**
/*
* Set a parameter to a Java String value. The driver converts this
* to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments
* size relative to the driver's limits on VARCHARs) when it sends it
......@@ -279,7 +279,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* Set a parameter to a Java array of bytes. The driver converts this
* to a SQL VARBINARY or LONGVARBINARY (depending on the argument's
* size relative to the driver's limits on VARBINARYs) when it sends
......@@ -319,7 +319,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* Set a parameter to a java.sql.Date value. The driver converts this
* to a SQL DATE value when it sends it to the database.
*
......@@ -350,7 +350,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
//set(parameterIndex, df.format(new java.util.Date(x.getTime()+86400000)));
}
/**
/*
* Set a parameter to a java.sql.Time value. The driver converts
* this to a SQL TIME value when it sends it to the database.
*
......@@ -370,7 +370,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* Set a parameter to a java.sql.Timestamp value. The driver converts
* this to a SQL TIMESTAMP value when it sends it to the database.
*
......@@ -394,7 +394,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* When a very large ASCII value is input to a LONGVARCHAR parameter,
* it may be more practical to send it via a java.io.InputStream.
* JDBC will read the data from the stream as needed, until it reaches
......@@ -444,7 +444,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* When a very large Unicode value is input to a LONGVARCHAR parameter,
* it may be more practical to send it via a java.io.InputStream.
* JDBC will read the data from the stream as needed, until it reaches
......@@ -493,7 +493,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* When a very large binary value is input to a LONGVARBINARY parameter,
* it may be more practical to send it via a java.io.InputStream.
* JDBC will read the data from the stream as needed, until it reaches
......@@ -572,7 +572,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
}
}
/**
/*
* In general, parameter values remain in force for repeated used of a
* Statement. Setting a parameter value automatically clears its
* previous value. However, in coms cases, it is useful to immediately
......@@ -589,7 +589,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
inStrings[i] = null;
}
/**
/*
* Set the value of a parameter using an object; use the java.lang
* equivalent objects for integral values.
*
......@@ -672,7 +672,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
setObject(parameterIndex, x, targetSqlType, 0);
}
/**
/*
* This stores an Object into a parameter.
* <p>New for 6.4, if the object is not recognised, but it is
* Serializable, then the object is serialised using the
......@@ -715,7 +715,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
setLong(parameterIndex, connection.putObject(x));
}
/**
/*
* Some prepared statements return multiple results; the execute method
* handles these complex statements as well as the simpler form of
* statements handled by executeQuery and executeUpdate
......@@ -740,7 +740,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
return super.execute(s.toString()); // in Statement class
}
/**
/*
* Returns the SQL statement with the current template values
* substituted.
*/
......@@ -765,7 +765,7 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
// END OF PUBLIC INTERFACE
// **************************************************************
/**
/*
* There are a lot of setXXX classes which all basically do
* the same thing. We need a method which actually does the
* set for us.
......
......@@ -16,7 +16,7 @@ import org.postgresql.largeobject.*;
import org.postgresql.util.*;
import org.postgresql.core.Encoding;
/**
/*
* A ResultSet provides access to a table of data generated by executing a
* Statement. The table rows are retrieved in sequence. Within a row its
* column values can be accessed in any order.
......@@ -59,7 +59,7 @@ import org.postgresql.core.Encoding;
*/
public class ResultSet extends org.postgresql.ResultSet implements java.sql.ResultSet
{
/**
/*
* Create a new ResultSet - Note that we create ResultSets to
* represent the results of everything.
*
......@@ -75,7 +75,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
super(conn, fields, tuples, status, updateCount, insertOID, binaryCursor);
}
/**
/*
* Create a new ResultSet - Note that we create ResultSets to
* represent the results of everything.
*
......@@ -91,7 +91,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
super(conn, fields, tuples, status, updateCount, 0, false);
}
/**
/*
* A ResultSet is initially positioned before its first row,
* the first call to next makes the first row the current row;
* the second call makes the second row the current row, etc.
......@@ -112,7 +112,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return true;
}
/**
/*
* In some cases, it is desirable to immediately release a ResultSet
* database and JDBC resources instead of waiting for this to happen
* when it is automatically closed. The close method provides this
......@@ -132,7 +132,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
rows.setSize(0);
}
/**
/*
* A column may have the value of SQL NULL; wasNull() reports whether
* the last column read had this special value. Note that you must
* first call getXXX on a column to try to read its value and then
......@@ -146,7 +146,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return wasNullFlag;
}
/**
/*
* Get the value of a column in the current row as a Java String
*
* @param columnIndex the first column is 1, the second is 2...
......@@ -166,7 +166,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return encoding.decode(this_row[columnIndex - 1]);
}
/**
/*
* Get the value of a column in the current row as a Java boolean
*
* @param columnIndex the first column is 1, the second is 2...
......@@ -185,7 +185,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return false; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java byte.
*
* @param columnIndex the first column is 1, the second is 2,...
......@@ -210,7 +210,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return 0; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java short.
*
* @param columnIndex the first column is 1, the second is 2,...
......@@ -235,7 +235,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return 0; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java int.
*
* @param columnIndex the first column is 1, the second is 2,...
......@@ -260,7 +260,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return 0; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java long.
*
* @param columnIndex the first column is 1, the second is 2,...
......@@ -285,7 +285,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return 0; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java float.
*
* @param columnIndex the first column is 1, the second is 2,...
......@@ -310,7 +310,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return 0; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java double.
*
* @param columnIndex the first column is 1, the second is 2,...
......@@ -335,7 +335,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return 0; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a
* java.math.BigDecimal object
*
......@@ -371,7 +371,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return null; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a Java byte array.
*
* <p>In normal use, the bytes represent the raw values returned by the
......@@ -432,7 +432,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return null;
}
/**
/*
* Get the value of a column in the current row as a java.sql.Date
* object
*
......@@ -454,7 +454,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
}
}
/**
/*
* Get the value of a column in the current row as a java.sql.Time
* object
*
......@@ -485,7 +485,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return null; // SQL NULL
}
/**
/*
* Get the value of a column in the current row as a
* java.sql.Timestamp object
*
......@@ -599,7 +599,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
}
}
/**
/*
* A column value can be retrieved as a stream of ASCII characters
* and then read in chunks from the stream. This method is
* particular suitable for retrieving large LONGVARCHAR values.
......@@ -653,7 +653,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
}
}
/**
/*
* A column value can also be retrieved as a stream of Unicode
* characters. We implement this as a binary stream.
*
......@@ -695,7 +695,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
}
}
/**
/*
* A column value can also be retrieved as a binary strea. This
* method is suitable for retrieving LONGVARBINARY values.
*
......@@ -738,7 +738,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return null;
}
/**
/*
* The following routines simply convert the columnName into
* a columnIndex and then call the appropriate routine above.
*
......@@ -827,7 +827,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return getBinaryStream(findColumn(columnName));
}
/**
/*
* The first warning reported by calls on this ResultSet is
* returned. Subsequent ResultSet warnings will be chained
* to this SQLWarning.
......@@ -848,7 +848,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return warnings;
}
/**
/*
* After this call, getWarnings returns null until a new warning
* is reported for this ResultSet
*
......@@ -859,7 +859,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
warnings = null;
}
/**
/*
* Get the name of the SQL cursor used by this ResultSet
*
* <p>In SQL, a result table is retrieved though a cursor that is
......@@ -882,7 +882,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return connection.getCursorName();
}
/**
/*
* The numbers, types and properties of a ResultSet's columns are
* provided by the getMetaData method
*
......@@ -894,7 +894,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return new ResultSetMetaData(rows, fields);
}
/**
/*
* Get the value of a column in the current row as a Java object
*
* <p>This method will return the value of the given column as a
......@@ -966,7 +966,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
}
}
/**
/*
* Get the value of a column in the current row as a Java object
*
*<p> This method will return the value of the given column as a
......@@ -986,7 +986,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
return getObject(findColumn(columnName));
}
/**
/*
* Map a ResultSet column name to a ResultSet column index
*
* @param columnName the name of the column
......
......@@ -16,7 +16,7 @@ import org.postgresql.util.*;
import java.sql.SQLException;
import java.sql.Types;
/**
/*
* A ResultSetMetaData object can be used to find out about the types and
* properties of the columns in a ResultSet
*
......@@ -27,7 +27,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
Vector rows;
Field[] fields;
/**
/*
* Initialise for a result with a tuple set and
* a field descriptor set
*
......@@ -40,7 +40,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
this.fields = fields;
}
/**
/*
* Whats the number of columns in the ResultSet?
*
* @return the number
......@@ -51,7 +51,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return fields.length;
}
/**
/*
* Is the column automatically numbered (and thus read-only)
* I believe that PostgreSQL does not support this feature.
*
......@@ -64,7 +64,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return false;
}
/**
/*
* Does a column's case matter? ASSUMPTION: Any field that is
* not obviously case insensitive is assumed to be case sensitive
*
......@@ -92,7 +92,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
}
}
/**
/*
* Can the column be used in a WHERE clause? Basically for
* this, I split the functions into two types: recognised
* types (which are always useable), and OTHER types (which
......@@ -119,7 +119,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
}
}
/**
/*
* Is the column a cash value? 6.1 introduced the cash/money
* type, which haven't been incorporated as of 970414, so I
* just check the type name for both 'cash' and 'money'
......@@ -135,7 +135,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return type_name.equals("cash") || type_name.equals("money");
}
/**
/*
* Indicates the nullability of values in the designated column.
*
* @param column the first column is 1, the second is 2...
......@@ -152,7 +152,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return columnNullableUnknown;
}
/**
/*
* Is the column a signed number? In PostgreSQL, all numbers
* are signed, so this is trivial. However, strings are not
* signed (duh!)
......@@ -182,7 +182,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
}
}
/**
/*
* What is the column's normal maximum width in characters?
*
* @param column the first column is 1, the second is 2, etc.
......@@ -238,7 +238,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return f.getLength();
}
/**
/*
* What is the suggested column title for use in printouts and
* displays? We suggest the ColumnName!
*
......@@ -251,7 +251,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return getColumnName(column);
}
/**
/*
* What's a column's name?
*
* @param column the first column is 1, the second is 2, etc.
......@@ -266,7 +266,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return "field" + column;
}
/**
/*
* What is a column's table's schema? This relies on us knowing
* the table name....which I don't know how to do as yet. The
* JDBC specification allows us to return "" if this is not
......@@ -281,7 +281,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return "";
}
/**
/*
* What is a column's number of decimal digits.
*
* @param column the first column is 1, the second is 2...
......@@ -317,7 +317,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
}
}
/**
/*
* What is a column's number of digits to the right of the
* decimal point?
*
......@@ -354,7 +354,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
}
}
/**
/*
* Whats a column's table's name? How do I find this out? Both
* getSchemaName() and getCatalogName() rely on knowing the table
* Name, so we need this before we can work on them.
......@@ -368,7 +368,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return "";
}
/**
/*
* What's a column's table's catalog name? As with getSchemaName(),
* we can say that if getTableName() returns n/a, then we can too -
* otherwise, we need to work on it.
......@@ -382,7 +382,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return "";
}
/**
/*
* What is a column's SQL Type? (java.sql.Type int)
*
* @param column the first column is 1, the second is 2, etc.
......@@ -396,7 +396,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return getField(column).getSQLType();
}
/**
/*
* Whats is the column's data source specific type name?
*
* @param column the first column is 1, the second is 2, etc.
......@@ -408,7 +408,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return getField(column).getPGType();
}
/**
/*
* Is the column definitely not writable? In reality, we would
* have to check the GRANT/REVOKE stuff for this to be effective,
* and I haven't really looked into that yet, so this will get
......@@ -423,7 +423,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return false;
}
/**
/*
* Is it possible for a write on the column to succeed? Again, we
* would in reality have to check the GRANT/REVOKE stuff, which
* I haven't worked with as yet. However, if it isn't ReadOnly, then
......@@ -438,7 +438,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
return !isReadOnly(column);
}
/**
/*
* Will a write on this column definately succeed? Hmmm...this
* is a bad one, since the two preceding functions have not been
* really defined. I cannot tell is the short answer. I thus
......@@ -457,7 +457,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
// END OF PUBLIC INTERFACE
// ********************************************************
/**
/*
* For several routines in this package, we need to convert
* a columnIndex into a Field[] descriptor. Rather than do
* the same code several times, here it is.
......
......@@ -9,7 +9,7 @@ import java.sql.*;
import org.postgresql.util.PSQLException;
/**
/*
* A Statement object is used for executing a static SQL statement and
* obtaining the results produced by it.
*
......@@ -26,7 +26,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
{
private Connection connection; // The connection who created us
/**
/*
* Constructor for a Statement. It simply sets the connection
* that created us.
*
......@@ -37,7 +37,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
connection = c;
}
/**
/*
* Execute a SQL statement that retruns a single ResultSet
*
* @param sql typically a static SQL SELECT statement
......@@ -54,7 +54,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return result;
}
/**
/*
* Execute a SQL INSERT, UPDATE or DELETE statement. In addition
* SQL statements that return nothing such as SQL DDL statements
* can be executed
......@@ -71,7 +71,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return this.getUpdateCount();
}
/**
/*
* setCursorName defines the SQL cursor name that will be used by
* subsequent execute methods. This name can then be used in SQL
* positioned update/delete statements to identify the current row
......@@ -95,7 +95,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
connection.setCursorName(name);
}
/**
/*
* Execute a SQL statement that may return multiple results. We
* don't have to worry about this since we do not support multiple
* ResultSets. You can use getResultSet or getUpdateCount to
......@@ -114,7 +114,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet());
}
/**
/*
* getUpdateCount returns the current result as an update count,
* if the result is a ResultSet or there are no more results, -1
* is returned. It should only be called once per result.
......@@ -131,7 +131,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return ((org.postgresql.ResultSet)result).getResultCount();
}
/**
/*
* getMoreResults moves to a Statement's next result. If it returns
* true, this result is a ResulSet.
*
......
......@@ -7,7 +7,7 @@ import java.math.BigDecimal;
import org.postgresql.Field;
import org.postgresql.util.*;
/**
/*
* Array is used collect one column of query result data.
*
* <p>Read a field of type Array into either a natively-typed
......@@ -31,7 +31,7 @@ public class Array implements java.sql.Array
private int idx = 0;
private String rawString = null;
/**
/*
* Create a new Array
*
* @param conn a database connection
......
......@@ -8,7 +8,7 @@ package org.postgresql.jdbc2;
import java.sql.*;
import java.math.*;
/**
/*
* CallableStatement is used to execute SQL stored procedures.
*
* <p>JDBC provides a stored procedure SQL escape that allows stored
......@@ -41,7 +41,7 @@ import java.math.*;
public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement implements java.sql.CallableStatement
{
/**
/*
* @exception SQLException on failure
*/
public CallableStatement(Connection c, String q) throws SQLException
......@@ -49,7 +49,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
super(c, q);
}
/**
/*
* Before executing a stored procedure call you must explicitly
* call registerOutParameter to register the java.sql.Type of each
* out parameter.
......@@ -67,7 +67,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
{}
/**
/*
* You must also specify the scale for numeric/decimal types:
*
* <p>Note: When reading the value of an out parameter, you must use
......@@ -89,7 +89,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
//return true;
//}
/**
/*
* An OUT parameter may have the value of SQL NULL; wasNull
* reports whether the last value read has this special value.
*
......@@ -109,7 +109,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
//return null;
//}
/**
/*
* Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a
* Java String.
*
......@@ -129,7 +129,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
//return null;
//}
/**
/*
* Get the value of a BIT parameter as a Java boolean.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -141,7 +141,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return false;
}
/**
/*
* Get the value of a TINYINT parameter as a Java byte.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -153,7 +153,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return 0;
}
/**
/*
* Get the value of a SMALLINT parameter as a Java short.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -165,7 +165,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return 0;
}
/**
/*
* Get the value of an INTEGER parameter as a Java int.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -177,7 +177,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return 0;
}
/**
/*
* Get the value of a BIGINT parameter as a Java long.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -189,7 +189,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return 0;
}
/**
/*
* Get the value of a FLOAT parameter as a Java float.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -201,7 +201,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return (float) 0.0;
}
/**
/*
* Get the value of a DOUBLE parameter as a Java double.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -213,7 +213,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return 0.0;
}
/**
/*
* Get the value of a NUMERIC parameter as a java.math.BigDecimal
* object.
*
......@@ -230,7 +230,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return null;
}
/**
/*
* Get the value of a SQL BINARY or VARBINARY parameter as a Java
* byte[]
*
......@@ -248,7 +248,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
//return null;
//}
/**
/*
* Get the value of a SQL DATE parameter as a java.sql.Date object
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -260,7 +260,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return null;
}
/**
/*
* Get the value of a SQL TIME parameter as a java.sql.Time object.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -272,7 +272,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
return null;
}
/**
/*
* Get the value of a SQL TIMESTAMP parameter as a java.sql.Timestamp object.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
......@@ -296,7 +296,7 @@ public class CallableStatement extends org.postgresql.jdbc2.PreparedStatement im
// getObject returns a Java object for the parameter.
// See the JDBC spec's "Dynamic Programming" chapter for details.
/**
/*
* Get the value of a parameter as a Java object.
*
* <p>This method returns a Java object whose type coresponds to the
......
......@@ -16,8 +16,8 @@ import org.postgresql.fastpath.*;
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/**
* $Id: Connection.java,v 1.14 2001/10/25 05:59:59 momjian Exp $
/*
* $Id: Connection.java,v 1.15 2001/11/19 22:33:38 momjian Exp $
*
* A Connection represents a session with a specific database. Within the
* context of a Connection, SQL statements are executed and results are
......@@ -39,12 +39,12 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
// This is a cache of the DatabaseMetaData instance for this connection
protected DatabaseMetaData metadata;
/**
/*
* The current type mappings
*/
protected java.util.Map typemap;
/**
/*
* SQL statements without parameters are normally executed using
* Statement objects. If the same SQL statement is executed many
* times, it is more efficient to use a PreparedStatement
......@@ -59,7 +59,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY);
}
/**
/*
* SQL statements without parameters are normally executed using
* Statement objects. If the same SQL statement is executed many
* times, it is more efficient to use a PreparedStatement
......@@ -78,7 +78,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
}
/**
/*
* A SQL statement with or without IN parameters can be pre-compiled
* and stored in a PreparedStatement object. This object can then
* be used to efficiently execute this statement multiple times.
......@@ -109,7 +109,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return s;
}
/**
/*
* A SQL stored procedure call statement is handled by creating a
* CallableStatement for it. The CallableStatement provides methods
* for setting up its IN and OUT parameters and methods for executing
......@@ -142,7 +142,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
//return s;
}
/**
/*
* Tests to see if a Connection is closed.
*
* Peter Feb 7 2000: Now I've discovered that this doesn't actually obey the
......@@ -187,7 +187,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
}
}
/**
/*
* A connection's database is able to provide information describing
* its tables, its supported SQL grammar, its stored procedures, the
* capabilities of this connection, etc. This information is made
......@@ -203,7 +203,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return metadata;
}
/**
/*
* This overides the method in org.postgresql.Connection and returns a
* ResultSet.
*/
......@@ -237,7 +237,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
typemap = map;
}
/**
/*
* This overides the standard internal getObject method so that we can
* check the jdbc2 type map first
*
......@@ -280,7 +280,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
return sqlType;
}
/**
/*
* 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.
* They default automatically to Types.OTHER
......@@ -310,7 +310,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
"_bytea"
};
/**
/*
* This table holds the JDBC type for each entry above.
*
* Note: This must be in the same order as above
......
......@@ -3,7 +3,7 @@ package org.postgresql.jdbc2;
import org.postgresql.util.*;
import java.sql.*;
/**
/*
* This class extends java.sql.BatchUpdateException, and provides our
* internationalisation handling.
*/
......
......@@ -9,7 +9,7 @@ import java.sql.*;
import java.util.Vector;
import org.postgresql.util.*;
/**
/*
* A Statement object is used for executing a static SQL statement and
* obtaining the results produced by it.
*
......@@ -29,7 +29,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
private int resultsettype; // the resultset type to return
private int concurrency; // is it updateable or not?
/**
/*
* Constructor for a Statement. It simply sets the connection
* that created us.
*
......@@ -42,7 +42,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
concurrency = java.sql.ResultSet.CONCUR_READ_ONLY;
}
/**
/*
* Execute a SQL statement that retruns a single ResultSet
*
* @param sql typically a static SQL SELECT statement
......@@ -59,7 +59,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return result;
}
/**
/*
* Execute a SQL INSERT, UPDATE or DELETE statement. In addition
* SQL statements that return nothing such as SQL DDL statements
* can be executed
......@@ -76,7 +76,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return this.getUpdateCount();
}
/**
/*
* setCursorName defines the SQL cursor name that will be used by
* subsequent execute methods. This name can then be used in SQL
* positioned update/delete statements to identify the current row
......@@ -100,7 +100,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
connection.setCursorName(name);
}
/**
/*
* Execute a SQL statement that may return multiple results. We
* don't have to worry about this since we do not support multiple
* ResultSets. You can use getResultSet or getUpdateCount to
......@@ -135,7 +135,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet());
}
/**
/*
* getUpdateCount returns the current result as an update count,
* if the result is a ResultSet or there are no more results, -1
* is returned. It should only be called once per result.
......@@ -152,7 +152,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
return ((org.postgresql.ResultSet)result).getResultCount();
}
/**
/*
* getMoreResults moves to a Statement's next result. If it returns
* true, this result is a ResulSet.
*
......@@ -249,7 +249,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
throw org.postgresql.Driver.notImplemented();
}
/**
/*
* New in 7.1
*/
public void setResultSetConcurrency(int value) throws SQLException
......@@ -257,7 +257,7 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
concurrency = value;
}
/**
/*
* New in 7.1
*/
public void setResultSetType(int value) throws SQLException
......
......@@ -21,7 +21,7 @@ import org.postgresql.Field;
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/**
/*
* @see ResultSet
* @see ResultSetMetaData
* @see java.sql.ResultSet
......@@ -29,7 +29,7 @@ import org.postgresql.util.*;
public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
{
/**
/*
* Create a new ResultSet - Note that we create ResultSets to
* represent the results of everything.
*
......@@ -45,7 +45,7 @@ public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
super(conn, fields, tuples, status, updateCount, insertOID, binaryCursor);
}
/**
/*
* Create a new ResultSet - Note that we create ResultSets to
* represent the results of everything.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment