|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.jdbc.JDBCFormatter
Handles conversion of a StarTable into a new table in an RDBMS.
Nested Class Summary | |
static class |
JDBCFormatter.SqlColumn
Describes a column as it will be written to a table in an RDBMS. |
Constructor Summary | |
JDBCFormatter(Connection conn,
StarTable table)
Constructor. |
Method Summary | |
void |
createJDBCTable(String tableName)
Creates a new table in the database according to the input table of this formatter. |
JDBCFormatter.SqlColumn |
getColumn(int icol)
Returns the SqlColumn object describing how a given column of this formatter's input table will be written into the RDBMS. |
String |
getCreateStatement(String tableName)
Returns the text of a suitable CREATE TABLE statement. |
String |
getInsertStatement(String tableName)
Returns the text of a suitable parametric statement for inserting a row. |
int |
getSqlType(Class clazz)
Returns an SQL type code suitable for a given class. |
static void |
main(String[] args)
Main method. |
String |
typeName(int sqlType)
Returns the name used by the connection's database to reference a JDBC type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCFormatter(Connection conn, StarTable table) throws SQLException, IOException
conn
- JDBC connectiontable
- input tableMethod Detail |
public String getCreateStatement(String tableName)
tableName
- name of the new SQL tablepublic String getInsertStatement(String tableName)
tableName
- name SQL table for insertionpublic void createJDBCTable(String tableName) throws IOException, SQLException
tableName
- name of the new table to create in the database
IOException
SQLException
public JDBCFormatter.SqlColumn getColumn(int icol)
null
, it means that
column cannot, and will not, be written.
icol
- column index in input table
public int getSqlType(Class clazz)
clazz
- java class of data
Types
codespublic String typeName(int sqlType) throws SQLException
sqlType
- type id (as per Types
)
SQLException
public static void main(String[] args) throws IOException, SQLException
IOException
SQLException
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |