| java.lang.Object com.sqlmagic.tinysql.tinySQL com.sqlmagic.tinysql.dbfFile
dbfFile | public class dbfFile extends tinySQL (Code) | | dBase read/write access
author: Brian Jepson author: Marcel Ruff Added write access to dBase and JDK 2 support author: Thomas Morgner Changed ColumnName to 11 bytes and strip name author: after first occurence of 0x00. author: Types are now handled as java.sql.Types, not as character flag |
Method Summary | |
void | AlterTableAddCol(String tableName, Vector v) Creates new Columns in tableName, given a vector of
column definition (tsColumn) arrays.
It is necessary to copy the whole file to do this task. | void | AlterTableDropCol(String tableName, Vector v) | void | AlterTableRenameCol(String tableName, String oldColname, String newColname) | void | CreateTable(String tableName, Vector v) | void | DropTable(String fname) The DBF File class provides read-only access to DBF
files, so this baby should throw an exception. | public String | GetRecord(RandomAccessFile ff, DBFHeader dbfHeader, int recordNumber) | tinySQLTable | getTable(String tableName) Return a tinySQLTable object, given a table name. | static tsColumn | readColdef(RandomAccessFile ff, String tableName, int iCol, int locn) | void | setDataDir(String d) Creates a table given the name and a vector of
column definition (tsColumn) arrays. | static String | typeToLiteral(int type) | static int | typeToSQLType(String type) | void | writeColdef(RandomAccessFile ff, tsColumn coldef) |
debug | public static boolean debug(Code) | | |
dbfFile | public dbfFile()(Code) | | Constructs a new dbfFile object
|
dbfFile | public dbfFile(String d)(Code) | | Constructs a new dbfFile object
Parameters: d - directory with which to override the default data directory |
AlterTableAddCol | void AlterTableAddCol(String tableName, Vector v) throws IOException, tinySQLException(Code) | | Creates new Columns in tableName, given a vector of
column definition (tsColumn) arrays.
It is necessary to copy the whole file to do this task.
ALTER TABLE table [ * ] ADD [ COLUMN ] column type
Parameters: tableName - the name of the table Parameters: v - a Vector containing arrays of column definitions. See Also: tinySQL.AlterTableAddCol |
AlterTableDropCol | void AlterTableDropCol(String tableName, Vector v) throws IOException, tinySQLException(Code) | | Deletes Columns from tableName, given a vector of
column definition (tsColumn) arrays.
ALTER TABLE table DROP [ COLUMN ] column { RESTRICT | CASCADE }
Parameters: tableName - the name of the table Parameters: v - a Vector containing arrays of column definitions. See Also: tinySQL.AlterTableDropCol |
DropTable | void DropTable(String fname) throws tinySQLException(Code) | | The DBF File class provides read-only access to DBF
files, so this baby should throw an exception.
Parameters: fname - table name See Also: tinySQL.DropTable |
readColdef | static tsColumn readColdef(RandomAccessFile ff, String tableName, int iCol, int locn) throws tinySQLException(Code) | | Reading a column definition from file
Parameters: ff - file handle (correctly positioned) Parameters: iCol - index starts with 1 Parameters: locn - offset to the current column struct with column info |
setDataDir | void setDataDir(String d)(Code) | | Creates a table given the name and a vector of
column definition (tsColumn) arrays.
Parameters: tableName - the name of the table Parameters: v - a Vector containing arrays of column definitions. See Also: tinySQL.CreateTable |
typeToLiteral | static String typeToLiteral(int type)(Code) | | 'C' Char (max 254 bytes)
'N' '-.0123456789' (max 19 bytes)
'L' 'YyNnTtFf?' (1 byte)
'M' 10 digit .DBT block number
'D' 8 digit YYYYMMDD
Uses java.sql.Types as key
|
typeToSQLType | static int typeToSQLType(String type)(Code) | | 'C' Char (max 254 bytes)
'N' '-.0123456789' (max 19 bytes)
'L' 'YyNnTtFf?' (1 byte)
'M' 10 digit .DBT block number
'D' 8 digit YYYYMMDD
|
writeColdef | void writeColdef(RandomAccessFile ff, tsColumn coldef) throws tinySQLException(Code) | | Writing a column definition to file
NOTE: the file pointer (seek()) must be at the correct position
Parameters: ff - file handle (correctly positioned) Parameters: coldef - struct with column info |
Methods inherited from com.sqlmagic.tinysql.tinySQL | abstract void AlterTableAddCol(String tableName, Vector v) throws IOException, tinySQLException(Code)(Java Doc) abstract void AlterTableDropCol(String tableName, Vector v) throws IOException, tinySQLException(Code)(Java Doc) abstract void AlterTableRenameCol(String tableName, String oldColumnName, String newColumnName) throws tinySQLException(Code)(Java Doc) abstract void CreateTable(String tableName, Vector v) throws IOException, tinySQLException(Code)(Java Doc) abstract void DropTable(String tableName) throws tinySQLException(Code)(Java Doc) protected tsResultSet SelectStatement(Hashtable t, Vector c, tinySQLWhere w, String ot, boolean distinct, Object stmt) throws tinySQLException(Code)(Java Doc) protected void contSelectStatement(tsResultSet jrs) throws tinySQLException(Code)(Java Doc) abstract tinySQLTable getTable(String tableName) throws tinySQLException(Code)(Java Doc) protected tsResultSet sql(Object s) throws tinySQLException(Code)(Java Doc) public tsResultSet sqlexec() throws tinySQLException(Code)(Java Doc) public tsResultSet sqlexec(tinySQLStatement s) throws tinySQLException(Code)(Java Doc) public tsResultSet sqlexec(tinySQLPreparedStatement s) throws tinySQLException(Code)(Java Doc)
|
|
|