org.hsqldb
Class Column

java.lang.Object
  extended byorg.hsqldb.Column

public class Column
extends Object

Implementation of SQL table columns as defined in DDL statements with static methods to process their values.

Version:
1.7.0

Field Summary
 org.hsqldb.HsqlNameManager.HsqlName columnName
           
 
Method Summary
static Object convertObject(Object o, int type)
          Convert an object into a Java object that represents its SQL type.
static String createSQLString(double x)
           
static String createSQLString(String s)
          Turns a java string into a quoted SQL string
static byte[] hexToByteArray(String hexString)
          Converts the specified hexadecimal digit String to an equivalent array of bytes.
 boolean isPrimaryKey()
          Is this single column primary key of the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnName

public org.hsqldb.HsqlNameManager.HsqlName columnName
Method Detail

isPrimaryKey

public boolean isPrimaryKey()
Is this single column primary key of the table.

Returns:
boolean

convertObject

public static Object convertObject(Object o,
                                   int type)
                            throws HsqlException
Convert an object into a Java object that represents its SQL type.

All internal type conversion operations start with this method. If a direct conversion doesn't take place, the object is converted into a string first and an attempt is made to convert the string into the target type.
One objective of this mehod is to ensure the Object can be converted to the given SQL type. For example, a very large BIGINT value cannot be narrowed down to an INTEGER or SMALLINT.
Type conversion performed by this method has gradually evolved in 1.7.2 to allow narrowing of numeric types in all cases according to the SQL standard.
Another new objective is to normalize DATETIME values.
Objects set via JDBC PreparedStatement use this method to convert the data to the Java type that is required for custom serialization by the engine.

Parameters:
o -
type -
Returns:
result
Throws:
HsqlException

createSQLString

public static String createSQLString(double x)

createSQLString

public static String createSQLString(String s)
Turns a java string into a quoted SQL string

Returns:
quoted SQL string

hexToByteArray

public static byte[] hexToByteArray(String hexString)
                             throws HsqlException
Converts the specified hexadecimal digit String to an equivalent array of bytes.

Parameters:
hexString - a String of hexadecimal digits
Returns:
a byte array equivalent to the specified string of hexadecimal digits
Throws:
HsqlException - if the specified string contains non-hexadecimal digits.


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.