uk.ac.starlink.table.jdbc
Class TypeMappers

java.lang.Object
  extended by uk.ac.starlink.table.jdbc.TypeMappers

public class TypeMappers
extends java.lang.Object

TypeMapper implementation classes.

Since:
2 Feb 2010

Field Summary
static TypeMapper IDENTITY
          TypeMapper implementation which performs no conversions.
static TypeMapper STANDARD
          TypeMapper implementation which performs generally useful conversions.
 
Method Summary
static ValueHandler createIdentityValueHandler(java.sql.ResultSetMetaData meta, int jcol1)
          Constructs a new ValueHandler which performs no conversions.
static ValueHandler createStringValueHandler(java.sql.ResultSetMetaData meta, int jcol1)
          Constructs a new ValueHandler which converts values to Strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD

public static final TypeMapper STANDARD
TypeMapper implementation which performs generally useful conversions. In particular, Date subclasses (including java.sql.Date, java.sql.Time and java.sql.Timestamp are turned into Strings. The intention is that by using this implementation you will get an output table which can be written using non-specialist output formats such as FITS and VOTable.


IDENTITY

public static final TypeMapper IDENTITY
TypeMapper implementation which performs no conversions. The output types are just as JDBC provides them.

Method Detail

createIdentityValueHandler

public static ValueHandler createIdentityValueHandler(java.sql.ResultSetMetaData meta,
                                                      int jcol1)
                                               throws java.sql.SQLException
Constructs a new ValueHandler which performs no conversions.

Parameters:
meta - JDBC metadata object
jcol1 - JDBC column index (first column is 1)
Throws:
java.sql.SQLException

createStringValueHandler

public static ValueHandler createStringValueHandler(java.sql.ResultSetMetaData meta,
                                                    int jcol1)
                                             throws java.sql.SQLException
Constructs a new ValueHandler which converts values to Strings.

Parameters:
meta - JDBC metadata object
jcol1 - JDBC column index (first column is 1)
Throws:
java.sql.SQLException

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.