@Deprecated
public class Dbf
extends java.lang.Object
Construct it with a URL or File (including the .dbf) this causes the header and field definitions to be read.
Later queries return rows or columns of the database.
If a URL is specified then the whole file is read into memory
if a file is specified then a randomAccess system is used.
Constructor and Description |
---|
Dbf(java.io.File file)
Deprecated.
|
Dbf(java.io.InputStream in)
Deprecated.
|
Dbf(java.lang.String name)
Deprecated.
|
Dbf(java.net.URL url)
Deprecated.
Constructor, opens the file and reads the header infomation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuffer |
GetDbfRec(int row)
Deprecated.
fetches the rowth row of the file
|
java.lang.StringBuffer |
getFieldName(int col)
Deprecated.
|
int |
getFieldNumber(java.lang.String name)
Deprecated.
looks up the field number for the given named column
|
char |
getFieldType(int col)
Deprecated.
|
int |
getFileSize()
Deprecated.
Returns the size of the database file.
|
java.lang.Float[] |
getFloatCol(int col)
Deprecated.
Fetches a column of Floats from the database file.
|
java.lang.Float[] |
getFloatCol(int col,
int start,
int end)
Deprecated.
Fetches a part column of Floats from the database file.
|
java.lang.Integer[] |
getIntegerCol(int col)
Deprecated.
Fetches a column of Integers from the database file.
|
java.lang.Integer[] |
getIntegerCol(int col,
int start,
int end)
Deprecated.
Fetches a part column of Integers from the database file.
|
int |
getLastRec()
Deprecated.
Returns the number of records in the database file.
|
java.lang.String |
getLastUpdate()
Deprecated.
Returns the date of the last update of the file as a string.
|
java.lang.StringBuffer |
GetNextDbfRec()
Deprecated.
gets the next record and returns it as a string.
|
int |
getNumFields()
Deprecated.
Returns the number of fields in the records in the database file.
|
int |
getRecSize()
Deprecated.
Returns the size of the records in the database file.
|
java.lang.String[] |
getStringCol(int col)
Deprecated.
Fetches a column of Strings from the database file.
|
java.lang.String[] |
getStringCol(int col,
int start,
int end)
Deprecated.
Fetches a part column of Strings from the database file.
|
java.util.Vector |
ParseDbfRecord(int row)
Deprecated.
fetches the rowth row of the file and parses it into an vector
of objects.
|
java.util.Vector |
ParseRecord(java.lang.StringBuffer rec)
Deprecated.
Parses the record stored in the StringBuffer rec into a vector of
objects
|
public DbfFieldDef[] fielddef
public static final int DBF_CENTURY
public static final int DBF_MAXLEN
public static final int DBF_NAMELEN
public static final int DBF3_MAXFIELDS
public static final int DBF4_MAXFIELDS
public static final int DBF_MAXFIELDS
public static final int DBF_BUFFSIZE
public static final int DBF_END_OF_DEFS
public static final int DBF_OK
public static final int DBF_READ_HEAD
public static final int DBF_BAD_DBFID
public static final int DBF_WRITE_HEAD
public static final int DBF_READ_DEFS
public static final int DBF_TOO_MANY_FIELDS
public static final int DBF_NO_FIELDS
public static final int DBF_BAD_EODEFS
public static final int DBF_WRITE_DEFS
public static final int DBF_BAD_ITYPE
public static final int DBF_CANNOT_DO_MEMO
public static final int DBF_BAD_INT_WIDTH
public static final int DBF_BAD_OFFSET
public static final int DBF_FLOATING_N
public static final int DBF_READ_DATA
public static final int DBF_UNPRINT_DATA
public static final int DBF_WRITE_DATA
public static final int DBF_INT_EXP
public static final int DBF_INT_REAL
public static final int DBF_INT_JUNK
public static final int DBF_REC_DELETED
public static final int DBF_ALL_DELETED
public static final int DBF_BAD_SIZEOF
public static final int DBF_REC_TOO_LONG
public static final int DBF_TOO_WIDE_FOR_INF
public static final int DBF_MALLOC_FIELD
public static final int DBF_MALLOC
public static final int DBF_GET_DATE
public Dbf(java.net.URL url) throws java.io.IOException, DbfFileException
url
- the url to be openedjava.io.IOException
- If the file can't be opened.DbfFileException
- If there is an error reading header.public Dbf(java.io.InputStream in) throws java.io.IOException, DbfFileException
java.io.IOException
DbfFileException
public Dbf(java.lang.String name) throws java.io.IOException, DbfFileException
java.io.IOException
DbfFileException
public Dbf(java.io.File file) throws java.io.IOException, DbfFileException
java.io.IOException
DbfFileException
public java.lang.String getLastUpdate()
public int getLastRec()
public int getRecSize()
public int getNumFields()
public int getFieldNumber(java.lang.String name)
name
- A String for the name to look uppublic int getFileSize()
public java.lang.StringBuffer getFieldName(int col)
public char getFieldType(int col)
public java.lang.StringBuffer GetNextDbfRec() throws java.io.IOException
java.io.IOException
- on read error.public java.lang.StringBuffer GetDbfRec(int row) throws java.io.IOException
row
- - the row to fetchjava.io.IOException
- on read error.public java.util.Vector ParseDbfRecord(int row) throws java.io.IOException
row
- - the row to fetchjava.io.IOException
- on read error.public java.util.Vector ParseRecord(java.lang.StringBuffer rec)
rec
- the record to be parsed.public java.lang.Integer[] getIntegerCol(int col) throws java.io.IOException, DbfFileException
col
- - the column to fetchjava.io.IOException
- - on read errorDbfFileException
- - column is not an Integer.public java.lang.Integer[] getIntegerCol(int col, int start, int end) throws java.io.IOException, DbfFileException
col
- - the column to fetchstart
- - the row to start fetching fromend
- - the row to stop fetching at.java.io.IOException
- - on read errorDbfFileException
- - column is not an Integer.public java.lang.Float[] getFloatCol(int col) throws DbfFileException, java.io.IOException
col
- - the column to fetchjava.io.IOException
- - on read errorDbfFileException
- - column is not an Integer.public java.lang.Float[] getFloatCol(int col, int start, int end) throws DbfFileException, java.io.IOException
col
- - the column to fetchstart
- - the row to start fetching fromend
- - the row to stop fetching at.java.io.IOException
- - on read errorDbfFileException
- - column is not an Integer.public java.lang.String[] getStringCol(int col) throws DbfFileException, java.io.IOException
col
- - the column to fetchjava.io.IOException
- - on read errorDbfFileException
- - column is not an Integer.public java.lang.String[] getStringCol(int col, int start, int end) throws DbfFileException, java.io.IOException
col
- - the column to fetchstart
- - the row to start fetching fromend
- - the row to stop fetching at.java.io.IOException
- - on read errorDbfFileException
- - column is not an Integer.