|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xBaseJ.DBF
Field Summary | |
static byte |
DBASEIII
|
static byte |
DBASEIV
|
static char |
READ_ONLY
|
static java.lang.String |
xBaseJVersion
|
Constructor Summary | |
DBF(java.lang.String DBFname)
creates an DBF object and opens existing database file in read/write mode. |
|
DBF(java.lang.String DBFname,
boolean destroy)
creates a new DBF file or replaces an existing database file, w/o format assumes dbaseiii file format. |
|
DBF(java.lang.String DBFname,
boolean destroy,
java.lang.String inEncodeType)
creates a new DBF file or replaces an existing database file, w/o format assumes dbaseiii file format. |
|
DBF(java.lang.String DBFname,
char readOnly)
creates an DBF object and opens existing database file in readonly mode. |
|
DBF(java.lang.String DBFname,
char readOnly,
java.lang.String inEncodeType)
creates an DBF object and opens existing database file in readonly mode. |
|
DBF(java.lang.String DBFname,
int format,
boolean destroy)
creates a new DBF file or replaces an existing database file. |
|
DBF(java.lang.String DBFname,
int format,
boolean destroy,
java.lang.String inEncodeType)
creates a new DBF file or replaces an existing database file. |
|
DBF(java.lang.String DBFname,
java.lang.String inEncodeType)
creates an DBF object and opens existing database file in read/write mode. |
Method Summary | |
void |
addField(xBaseJ.Field aField)
adds a new Field to a database |
void |
addField(xBaseJ.Field[] aField)
adds an array of new Fields to a database |
void |
changeField(xBaseJ.Field oldField,
xBaseJ.Field newField)
changes a Field in a database NOT FULLY IMPLEMENTED |
void |
close()
closes the database. |
xBaseJ.Index |
createIndex(java.lang.String filename,
java.lang.String index,
boolean unique)
creates a new Index as a NDX file, assumes NDX file does not exist. |
xBaseJ.Index |
createIndex(java.lang.String filename,
java.lang.String index,
boolean destroy,
boolean unique)
creates a new Index as a NDX file. |
xBaseJ.Index |
createTag(java.lang.String tagname,
java.lang.String tagIndex,
boolean unique)
creates a tag in the MDX file. |
void |
delete()
marks the current records as deleted. |
boolean |
deleted()
returns true if record is marked for deletion |
void |
dropField(xBaseJ.Field aField)
removes a Field from a database NOT FULLY IMPLEMENTED |
boolean |
find(java.lang.String keyString)
used to find a record with an equal or greater string value. |
boolean |
find(java.lang.String keyString,
boolean lock)
used to find a record with an equal or greater string value. |
boolean |
findExact(java.lang.String keyString)
used to find a record with an equal string value. |
boolean |
findExact(java.lang.String keyString,
boolean lock)
used to find a record with an equal string value. |
void |
findNext()
used to get the next record in the index list. |
void |
findNext(boolean lock)
used to get the next record in the index list. |
void |
findPrev()
used to get the previous record in the index list. |
void |
findPrev(boolean lock)
used to get the previous record in the index list. |
int |
fldcount()
Deprecated. use getFieldCount |
int |
getCurrentRecordNumber()
returns the current record number |
static java.lang.String |
getEncodingType()
gets the character encoding string value. |
xBaseJ.Field |
getField(int i)
returns a Field object by its relative position. |
xBaseJ.Field |
getField(java.lang.String name)
returns a Field object by its name in the database. |
int |
getFieldCount()
returns the number of fields in a database |
xBaseJ.Index |
getIndex(int indexPosition)
gets an Index object associated with the database. |
int |
getIndexCount()
returns the number of known index files and tags |
java.lang.String |
getName()
returns the full path name of the database |
int |
getRecordCount()
returns the number of records in a database |
int |
getVersion()
returns the dbase version field. |
java.io.File |
getXML(java.lang.String inFileName)
generates an xml string representation using xbase.dtd |
void |
gotoRecord(int recno)
used to read a record at a particular place in the database. |
void |
gotoRecord(int recno,
boolean lock)
used to read a record at a particular place in the database. |
void |
lock()
locks the entire database will try 5 times within the fileLockTimeOut specified in xBaseJ.property fileLockTimeOut, default 5000 milliseconds (5 seconds) |
void |
pack()
packs a DBF by removing deleted records and memo fields. |
void |
read()
used to read the next record, after the current record pointer, in the database. |
void |
read(boolean lock)
used to read the next record, after the current record pointer, in the database. |
void |
readPrev()
used to read the previous record, before the current record pointer, in the database. |
void |
readPrev(boolean lock)
used to read the previous record, before the current record pointer, in the database. |
int |
reccount()
Deprecated. use getRecordCount |
int |
recno()
Deprecated. use getCurrentRecordNumber |
static void |
setEncodingType(java.lang.String inType)
sets the character encoding variable. |
void |
setFileLockWait(long inLongWait)
sets the filelockwait timeout value in milliseconds defaults to 5000 milliseconds if negative value will not be set |
void |
startBottom()
used to position record pointer at the last record or index in the database. |
void |
startTop()
used to position record pointer at the first record or index in the database. |
void |
undelete()
marks the current records as not deleted. |
void |
update()
updates the record at the current position. |
void |
update(boolean lock)
updates the record at the current position. |
xBaseJ.Index |
useIndex(xBaseJ.Index ndx)
used to indicate the primary Index |
xBaseJ.Index |
useIndex(java.lang.String filename)
opens an Index file associated with the database. |
xBaseJ.Index |
useIndex(java.lang.String filename,
java.lang.String ID)
opens an Index file associated with the database |
xBaseJ.Index |
useIndexByID(java.lang.String ID)
used to indicate the primary Index. |
xBaseJ.Index |
useTag(java.lang.String tagname)
associates all Index operations with an existing tag. |
xBaseJ.Index |
useTag(java.lang.String tagname,
java.lang.String ID)
associates all Index operations with an existing tag. |
java.lang.String |
version()
|
void |
write()
used to write a new record in the database. |
void |
write(boolean lock)
used to write a new record in the database. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte DBASEIII
public static final byte DBASEIV
public static final char READ_ONLY
public static final java.lang.String xBaseJVersion
Constructor Detail |
public DBF(java.lang.String DBFname, boolean destroy) throws xBaseJException, java.io.IOException, java.lang.SecurityException
DBFname
- a new or existing database file, can be full or partial pathname
xBaseJException
- File does exist and told not to destroy it.
java.io.IOException
- Java error caused by called methods
java.lang.SecurityException
- Java error caused by called methods, most likely trying to create on a remote systempublic DBF(java.lang.String DBFname, int format, boolean destroy) throws xBaseJException, java.io.IOException, java.lang.SecurityException
DBFname
- a new or existing database file, can be full or partial pathnameformat
- use class constants DBASEIII or DBASEIVdestroy
- permission to destroy an existing database file
xBaseJException
- File does exist and told not to destroy it.
java.io.IOException
- Java error caused by called methods
java.lang.SecurityException
- Java error caused by called methods, most likely trying to create on a remote systempublic DBF(java.lang.String DBFname, char readOnly) throws xBaseJException, java.io.IOException
DBFname
- an existing database file, can be full or partial pathname
xBaseJException
- Can not find database
java.io.IOException
- Java error caused by called methodspublic DBF(java.lang.String DBFname) throws xBaseJException, java.io.IOException
DBFname
- an existing database file, can be full or partial pathname
xBaseJException
- Can not find database
java.io.IOException
- Java error caused by called methodspublic DBF(java.lang.String DBFname, boolean destroy, java.lang.String inEncodeType) throws xBaseJException, java.io.IOException, java.lang.SecurityException
DBFname
- a new or existing database file, can be full or partial pathname
xBaseJException
- File does exist and told not to destroy it.
java.io.IOException
- Java error caused by called methods
java.lang.SecurityException
- Java error caused by called methods, most likely trying to create on a remote systempublic DBF(java.lang.String DBFname, int format, boolean destroy, java.lang.String inEncodeType) throws xBaseJException, java.io.IOException, java.lang.SecurityException
DBFname
- a new or existing database file, can be full or partial pathnameformat
- use class constants DBASEIII or DBASEIVdestroy
- permission to destroy an existing database file
xBaseJException
- File does exist and told not to destroy it.
java.io.IOException
- Java error caused by called methods
java.lang.SecurityException
- Java error caused by called methods, most likely trying to create on a remote systempublic DBF(java.lang.String DBFname, char readOnly, java.lang.String inEncodeType) throws xBaseJException, java.io.IOException
DBFname
- an existing database file, can be full or partial pathname
xBaseJException
- Can not find database
java.io.IOException
- Java error caused by called methodspublic DBF(java.lang.String DBFname, java.lang.String inEncodeType) throws xBaseJException, java.io.IOException
DBFname
- an existing database file, can be full or partial pathname
xBaseJException
- Can not find database
java.io.IOException
- Java error caused by called methodsMethod Detail |
public java.lang.String version()
public void addField(xBaseJ.Field aField) throws xBaseJException, java.io.IOException
aField
- a predefined Field object
xBaseJException
- xBaseJ error caused by called methods
java.io.IOException
- Java error caused by called methodsField
public void addField(xBaseJ.Field[] aField) throws xBaseJException, java.io.IOException
aField
- an array of predefined Field object
xBaseJException
- passed an empty array or other error
java.io.IOException
- Java error caused by called methodsField
public void setFileLockWait(long inLongWait)
inLongWait
- long millisecondspublic void lock() throws java.io.IOException, xBaseJException
java.io.IOException
- - related to java.nio.channels and filelocks
xBaseJException
- - file lock wait timed out,public void dropField(xBaseJ.Field aField) throws xBaseJException, java.io.IOException
aField
- a field in the database
xBaseJException
- Field is not part of the database
java.io.IOException
- Java error caused by called methodsField
public void changeField(xBaseJ.Field oldField, xBaseJ.Field newField) throws xBaseJException, java.io.IOException
xBaseJException
- xBaseJ error caused by called methods
java.io.IOException
- Java error caused by called methodsField
public int fldcount()
public int reccount()
public int recno()
public int getFieldCount()
public int getRecordCount()
public int getCurrentRecordNumber()
public int getIndexCount()
public xBaseJ.Index getIndex(int indexPosition) throws xBaseJException
xBaseJException
- index value incorrectpublic xBaseJ.Index useIndex(java.lang.String filename) throws xBaseJException, java.io.IOException
filename
- an existing ndx file(can be full or partial pathname) or mdx tag
xBaseJException
- xBaseJ Fields defined in index do not match fields in database
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Index useIndex(java.lang.String filename, java.lang.String ID) throws xBaseJException, java.io.IOException
filename
- an existing Index file, can be full or partial pathnameID
- a unique id to define Index at run-time.
xBaseJException
- xBaseJ Fields defined in Index do not match Fields in database
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Index useIndex(xBaseJ.Index ndx) throws xBaseJException, java.io.IOException
xBaseJException
- xBaseJ Index not opened or not part of the database
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Index useIndexByID(java.lang.String ID) throws xBaseJException
xBaseJException
- xBaseJ Index not opened or not part of the databaseuseIndex(String,String)
public xBaseJ.Index useTag(java.lang.String tagname) throws xBaseJException
tagname
- an existing tag name in the production MDX file
xBaseJException
- no MDX file
tagname not foundpublic xBaseJ.Index useTag(java.lang.String tagname, java.lang.String ID) throws xBaseJException, java.io.IOException
tagname
- an existing tag name in the production MDX fileID
- a unique id to define Index at run-time.
xBaseJException
- no MDX file
tagname not found
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Index createIndex(java.lang.String filename, java.lang.String index, boolean unique) throws xBaseJException, java.io.IOException
filename
- a new Index file nameindex
- string identifying Fields used in Indexunique
- boolean to indicate if the key is always unique
xBaseJException
- NDX file already exists
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Index createIndex(java.lang.String filename, java.lang.String index, boolean destroy, boolean unique) throws xBaseJException, java.io.IOException
filename
- a new Index file nameindex
- string identifying Fields used in Indexdestroy
- permission to destory NDX if file existsunique
- boolean to indicate if the key is always unique
xBaseJException
- NDX file already exists
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Index createTag(java.lang.String tagname, java.lang.String tagIndex, boolean unique) throws xBaseJException, java.io.IOException
tagname
- a non-existing tag name in the production MDX filetagIndex
- string identifying Fields used in Indexunique
- boolean to indicate if the key is always unique
xBaseJException
- no MDX file
tagname already exists
java.io.IOException
- Java error caused by called methodspublic boolean find(java.lang.String keyString, boolean lock) throws xBaseJException, java.io.IOException
keyString
- a search stringlock
- boolean lock record indicator
xBaseJException
- xBaseJ no Indexs opened with database
java.io.IOException
- Java error caused by called methodspublic boolean find(java.lang.String keyString) throws xBaseJException, java.io.IOException
keyString
- a search string
xBaseJException
- xBaseJ no Indexs opened with database
java.io.IOException
- Java error caused by called methodspublic boolean findExact(java.lang.String keyString, boolean lock) throws xBaseJException, java.io.IOException
keyString
- a search stringlock
- - boolean lock record indiator
xBaseJException
- xBaseJ no Indexs opened with database
java.io.IOException
- Java error caused by called methodspublic boolean findExact(java.lang.String keyString) throws xBaseJException, java.io.IOException
keyString
- a search string
xBaseJException
- xBaseJ no Indexs opened with database
java.io.IOException
- Java error caused by called methodspublic void findNext(boolean lock) throws xBaseJException, java.io.IOException
lock
- - boolean lock record indicator
xBaseJException
- xBaseJ Index not opened or not part of the database
eof - end of file
java.io.IOException
- Java error caused by called methodspublic void findNext() throws xBaseJException, java.io.IOException
xBaseJException
- xBaseJ Index not opened or not part of the database
eof - end of file
java.io.IOException
- Java error caused by called methodspublic void findPrev(boolean lock) throws xBaseJException, java.io.IOException
lock
- boolean lock record indicator
xBaseJException
- xBaseJ Index not opened or not part of the database
tof - top of file
java.io.IOException
- Java error caused by called methodspublic void findPrev() throws xBaseJException, java.io.IOException
xBaseJException
- xBaseJ Index not opened or not part of the database
tof - top of file
java.io.IOException
- Java error caused by called methodspublic void read(boolean lock) throws xBaseJException, java.io.IOException
lock
- - boolean lock record indicator
xBaseJException
- usually the end of file condition
java.io.IOException
- Java error caused by called methodspublic void read() throws xBaseJException, java.io.IOException
xBaseJException
- usually the end of file condition
java.io.IOException
- Java error caused by called methodspublic void readPrev(boolean lock) throws xBaseJException, java.io.IOException
lock
- - boolean lock record indicator
xBaseJException
- usually the top of file condition
java.io.IOException
- Java error caused by called methodspublic void readPrev() throws xBaseJException, java.io.IOException
xBaseJException
- usually the top of file condition
java.io.IOException
- Java error caused by called methodspublic void gotoRecord(int recno, boolean lock) throws xBaseJException, java.io.IOException
recno
- the relative position of the record to readlock
- - boolean lock record indicator
xBaseJException
- passed an negative number, 0 or value greater than the number of records in database
java.io.IOException
- Java error caused by called methodspublic void gotoRecord(int recno) throws xBaseJException, java.io.IOException
recno
- the relative position of the record to read
xBaseJException
- passed an negative number, 0 or value greater than the number of records in database
java.io.IOException
- Java error caused by called methodspublic void startTop() throws xBaseJException, java.io.IOException
xBaseJException
- most likely no records in database
java.io.IOException
- Java error caused by called methodspublic void startBottom() throws xBaseJException, java.io.IOException
xBaseJException
- most likely no records in database
java.io.IOException
- Java error caused by called methodspublic void write(boolean lock) throws xBaseJException, java.io.IOException
lock
- - boolean lock indicator - locks the entire file
during the write process and then unlocks the file.
xBaseJException
- any one of several errors
java.io.IOException
- Java error caused by called methodspublic void write() throws xBaseJException, java.io.IOException
xBaseJException
- any one of several errors
java.io.IOException
- Java error caused by called methodspublic void update(boolean lock) throws xBaseJException, java.io.IOException
lock
- - boolean lock indicator - locks the entire file
during the write process and then unlocks the file.
Also record lock will be released, regardless of parameter value
xBaseJException
- any one of several errors
java.io.IOException
- Java error caused by called methodspublic void update() throws xBaseJException, java.io.IOException
xBaseJException
- any one of several errors
java.io.IOException
- Java error caused by called methodspublic void delete() throws java.io.IOException, xBaseJException
xBaseJException
- usually occurs when no record has been read
java.io.IOException
- Java error caused by called methodspublic void undelete() throws java.io.IOException, xBaseJException
xBaseJException
- usually occurs when no record has been read.
java.io.IOException
- Java error caused by called methodspublic void close() throws java.io.IOException
java.io.IOException
- Java error caused by called methodspublic xBaseJ.Field getField(int i) throws java.lang.ArrayIndexOutOfBoundsException, xBaseJException
i
- Field number
xBaseJException
- usually occurs when Field number is less than 1 or greater than the number of fields
java.lang.ArrayIndexOutOfBoundsException
public xBaseJ.Field getField(java.lang.String name) throws xBaseJException, java.lang.ArrayIndexOutOfBoundsException
name
- Field name
xBaseJException
- Field name is not correct
java.lang.ArrayIndexOutOfBoundsException
public java.lang.String getName()
public boolean deleted()
public void pack() throws xBaseJException, java.io.IOException, java.lang.SecurityException, java.lang.CloneNotSupportedException
xBaseJException
- File does exist and told not to destroy it.
java.io.IOException
- Java error caused by called methods
java.lang.CloneNotSupportedException
- Java error caused by called methods
java.lang.SecurityException
public int getVersion()
public static void setEncodingType(java.lang.String inType)
public static java.lang.String getEncodingType()
public java.io.File getXML(java.lang.String inFileName) throws java.io.IOException, xBaseJException
inFileName
- - String
java.io.IOException
xBaseJException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |