Reformat JDBC classes and add new JDK 1.4 classes and methods.
* java/sql/ParameterMetaData.java, java/sql/SQLPermission.java, java/sql/Savepoint.java: New files. * java/sql/Array.java, java/sql/BatchUpdateException.java, java/sql/Blob.java, java/sql/CallableStatement.java, java/sql/Clob.java, java/sql/Connection.java, java/sql/DataTruncation.java, java/sql/DatabaseMetaData.java, java/sql/Date.java, java/sql/Driver.java, java/sql/DriverManager.java, java/sql/DriverPropertyInfo.java, java/sql/PreparedStatement.java, java/sql/Ref.java, java/sql/ResultSet.java, java/sql/ResultSetMetaData.java, java/sql/SQLData.java java/sql/SQLException.java, java/sql/SQLInput.java, java/sql/SQLOutput.java, java/sql/SQLWarning.java java/sql/Statement.java, java/sql/Struct.java, java/sql/Time.java, java/sql/Timestamp.java, java/sql/Types.java: Updated to JDBC 3.0 (JDK 1.4) specification. * javax/sql/ConnectionEvent.java, javax/sql/ConnectionEventListener.java, javax/sql/ConnectionPoolDataSource.java, javax/sql/DataSource.java, javax/sql/PooledConnection.java, javax/sql/RowSetEvent.java, javax/sql/RowSetInternal.java, javax/sql/RowSet.java, javax/sql/RowSetListener.java, javax/sql/RowSetMetaData.java, javax/sql/RowSetReader.java, javax/sql/RowSetWriter.java, javax/sql/XAConnection.java, javax/sql/XADataSource.java: New files. * Makefile.am: Add new files. * Makefile.in: Rebuilt. From-SVN: r54871
This commit is contained in:
parent
00b94a4440
commit
f2390faddf
46 changed files with 8948 additions and 9156 deletions
|
@ -1,5 +1,5 @@
|
|||
/* DataTruncation.java -- Warning when data has been truncated.
|
||||
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -35,7 +35,6 @@ this exception to your version of the library, but you are not
|
|||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package java.sql;
|
||||
|
||||
/**
|
||||
|
@ -44,164 +43,115 @@ package java.sql;
|
|||
*
|
||||
* @author Aaron M. Renn (arenn@urbanophile.com)
|
||||
*/
|
||||
public class DataTruncation extends SQLWarning
|
||||
public class DataTruncation extends SQLWarning
|
||||
{
|
||||
static final long serialVersionUID = 6464298989504059473L;
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
* The original size of the data.
|
||||
*/
|
||||
private int dataSize;
|
||||
|
||||
/*
|
||||
* Instance Variables
|
||||
*/
|
||||
/**
|
||||
* The index of the parameter or column whose value was truncated.
|
||||
*/
|
||||
private int index;
|
||||
|
||||
/**
|
||||
* The original size of the data.
|
||||
* @serialized
|
||||
*/
|
||||
private int dataSize;
|
||||
/**
|
||||
* Indicates whether or not a parameter value was truncated.
|
||||
*/
|
||||
private boolean parameter;
|
||||
|
||||
/**
|
||||
* The index of the parameter or column whose value was truncated.
|
||||
* @serialized
|
||||
*/
|
||||
private int index;
|
||||
/**
|
||||
* Indicates whether or not a data column value was truncated.
|
||||
*/
|
||||
private boolean read;
|
||||
|
||||
/**
|
||||
* Indicates whether or not a parameter value was truncated.
|
||||
* @serialized
|
||||
*/
|
||||
private boolean parameter;
|
||||
/**
|
||||
* This is the size of the data after truncation.
|
||||
*/
|
||||
private int transferSize;
|
||||
|
||||
/**
|
||||
* Indicates whether or not a data column value was truncated.
|
||||
* @serialized
|
||||
*/
|
||||
private boolean read;
|
||||
/**
|
||||
* This method initializes a new instance of <code>DataTruncation</code>
|
||||
* with the specified values. The descriptive error message for this
|
||||
* exception will be "Data truncation", the SQL state will be "01004"
|
||||
* and the vendor specific error code will be set to 0.
|
||||
*
|
||||
* @param index The index of the parameter or column that was truncated.
|
||||
* @param parameter <code>true</code> if a parameter was truncated,
|
||||
* <code>false</code> otherwise.
|
||||
* @param read <code>true</code> if a data column was truncated,
|
||||
* <code>false</code> otherwise.
|
||||
* @param dataSize The original size of the data.
|
||||
* @param transferSize The size of the data after truncation.
|
||||
*/
|
||||
public DataTruncation(int index, boolean parameter, boolean read, int
|
||||
dataSize, int transferSize)
|
||||
{
|
||||
super("Data truncation", "01004");
|
||||
|
||||
/**
|
||||
* This is the size of the data after truncation.
|
||||
* @serialized
|
||||
*/
|
||||
private int transferSize;
|
||||
this.index = index;
|
||||
this.parameter = parameter;
|
||||
this.read = read;
|
||||
this.dataSize = dataSize;
|
||||
this.transferSize = transferSize;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
* This method returns the index of the column or parameter that was
|
||||
* truncated.
|
||||
*
|
||||
* @return The index of the column or parameter that was truncated.
|
||||
*/
|
||||
public int getIndex()
|
||||
{
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static Variables
|
||||
*/
|
||||
/**
|
||||
* This method determines whether or not it was a parameter that was
|
||||
* truncated.
|
||||
*
|
||||
* @return <code>true</code> if a parameter was truncated, <code>false</code>
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getParameter()
|
||||
{
|
||||
return parameter;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the serialization UID for this class
|
||||
*/
|
||||
private static final long serialVersionUID = 6464298989504059473L;
|
||||
/**
|
||||
* This method determines whether or not it was a column that was
|
||||
* truncated.
|
||||
*
|
||||
* @return <code>true</code> if a column was truncated, <code>false</code>
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean getRead()
|
||||
{
|
||||
return read;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
* This method returns the original size of the parameter or column that
|
||||
* was truncated.
|
||||
*
|
||||
* @return The original size of the parameter or column that was truncated.
|
||||
*/
|
||||
public int getDataSize()
|
||||
{
|
||||
return dataSize;
|
||||
}
|
||||
|
||||
/*
|
||||
* Constructors
|
||||
*/
|
||||
|
||||
/**
|
||||
* This method initializes a new instance of <code>DataTruncation</code>
|
||||
* with the specified values. The descriptive error message for this
|
||||
* exception will be "Data truncation", the SQL state will be "01004"
|
||||
* and the vendor specific error code will be set to 0.
|
||||
*
|
||||
* @param index The index of the parameter or column that was truncated.
|
||||
* @param parameter <code>true</code> if a parameter was truncated,
|
||||
* <code>false</code> otherwise.
|
||||
* @param read <code>true</code> if a data column was truncated,
|
||||
* <code>false</code> otherwise.
|
||||
* @param dataSize The original size of the data.
|
||||
* @param transferSize The size of the data after truncation.
|
||||
*/
|
||||
public
|
||||
DataTruncation(int index, boolean parameter, boolean read, int dataSize,
|
||||
int transferSize)
|
||||
{
|
||||
super("Data truncation", "01004");
|
||||
|
||||
this.index = index;
|
||||
this.parameter = parameter;
|
||||
this.read = read;
|
||||
this.dataSize = dataSize;
|
||||
this.transferSize = transferSize;
|
||||
/**
|
||||
* This method returns the size of the parameter or column after it was
|
||||
* truncated.
|
||||
*
|
||||
* @return The size of the parameter or column after it was truncated.
|
||||
*/
|
||||
public int getTransferSize()
|
||||
{
|
||||
return transferSize;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* Instance Methods
|
||||
*/
|
||||
|
||||
/**
|
||||
* This method returns the index of the column or parameter that was
|
||||
* truncated.
|
||||
*
|
||||
* @return The index of the column or parameter that was truncated.
|
||||
*/
|
||||
public int
|
||||
getIndex()
|
||||
{
|
||||
return(index);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* This method determines whether or not it was a parameter that was
|
||||
* truncated.
|
||||
*
|
||||
* @return <code>true</code> if a parameter was truncated, <code>false</code>
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean
|
||||
getParameter()
|
||||
{
|
||||
return(parameter);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* This method determines whether or not it was a column that was
|
||||
* truncated.
|
||||
*
|
||||
* @return <code>true</code> if a column was truncated, <code>false</code>
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean
|
||||
getRead()
|
||||
{
|
||||
return(read);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* This method returns the original size of the parameter or column that
|
||||
* was truncated.
|
||||
*
|
||||
* @return The original size of the parameter or column that was truncated.
|
||||
*/
|
||||
public int
|
||||
getDataSize()
|
||||
{
|
||||
return(dataSize);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* This method returns the size of the parameter or column after it was
|
||||
* truncated.
|
||||
*
|
||||
* @return The size of the parameter or column after it was truncated.
|
||||
*/
|
||||
public int
|
||||
getTransferSize()
|
||||
{
|
||||
return(transferSize);
|
||||
}
|
||||
|
||||
} // class DataTruncation
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue