All Packages Class Hierarchy This Package Previous Next Index
Class xBaseJ.Client.DBF
java.lang.Object
|
+----xBaseJ.Client.DBF
- public class DBF
- extends Object
xBaseJ - java access to dBase files
Copyright 1997-8 - American Coders, LTD - Raleigh NC USA
All rights reserved
Currently supports only dBase III format DBF, DBT and NDX files
dBase IV format DBF, DBT, MDX and NDX files
Package expires on October 31, 1998
American Coders, Ltd
P. O. Box 97462
Raleigh, NC 27615 USA
1-919-846-2014
http://www.americancoders.com
- Version:
- 1.6.0
- Author:
- Joe McVerry, American Coders Ltd.
-
DBF(String, String, int)
- opens a DBF at the server
-
close()
-
closes the database NOT FULLY IMPLEMENTED
-
delete()
-
marks the current records as deleted
-
deleted()
-
-
find(String)
-
used to find a record with an equal or greater string value
when done the record pointer and field contents will be changed
-
findNext()
-
used to get the next record in the Index list
when done the record pointer and field contents will be changed
-
findPrev()
-
used to get the previous record in the Index list
when done the record pointer and field contents will be changed
-
fldcount()
-
-
getField(int)
-
-
getField(String)
-
-
getName()
-
-
gotoRecord(long)
-
used to read a record at a particular place in the database
when done the record pointer and field contents will be changed
-
read()
-
used to read the next record, after the current record pointer, in the database
when done the record pointer and field contents will be changed
-
readPrev()
-
used to read the previous record, before the current record pointer, in the database
when done the record pointer and field contents will be changed
-
reccount()
-
-
setLock(boolean)
-
locks/unlocks the whole table
-
setRecordLock(boolean)
-
locks/unlocks the current record.
-
undelete()
-
marks the current records as not deleted
-
update()
-
updates the record at the current position
-
useIndex(String)
-
opens an index associated with the database
-
write()
-
used to write a new record in the database
when done the record pointer is at the end of the database
DBF
public DBF(String inDBFname,
String inhost,
int inport) throws xBaseJException, IOException, UnknownHostException
- opens a DBF at the server
- Parameters:
- DBFname - database as defined on the server
- inhost - host name or ip address
- inport - host listening port
- Throws: xBaseJException
- File does exist and told not to destroy it.
- Throws: xBaseJException
- Told to destroy but operating system can not destroy
- Throws: IOException
- Java error caused by called methods
- Throws: SecurityException
- Java error caused by called methods, most likely trying to create on a remote system
setLock
public void setLock(boolean lockSwitch) throws xBaseJException, IOException
- locks/unlocks the whole table
- Parameters:
- lockSwitch - - true - lock the table, false - unlock
- Throws: xBaseJException
- most likely table already locked by another process
- Throws: IOException
- Java error caused by called methods
setRecordLock
public void setRecordLock(boolean lockSwitch) throws xBaseJException, IOException
- locks/unlocks the current record. You must read, write or find the record before locking
- Parameters:
- lockSwitch - - true - lock the record, false - unlock
- Throws: xBaseJException
- most likely table or record is already locked by another process
record cursor not on a valid record - read a record first
- Throws: IOException
- Java error caused by called methods
useIndex
public void useIndex(String name) throws xBaseJException, IOException
- opens an index associated with the database
- Parameters:
- indexname - an existing index as defined in Server's dbfs.dbf
- Throws: xBaseJException
- xBaseJ Fields defined in Index do not match Fields in database
- Throws: IOException
- Java error caused by called methods
find
public boolean find(String keyString) throws xBaseJException, IOException
- used to find a record with an equal or greater string value
when done the record pointer and field contents will be changed
- Parameters:
- keyString - a search string
- Returns:
- boolean - true if record found key matches input key
- Throws: xBaseJException
- xBaseJ no Indexs opened with database
- Throws: IOException
- Java error caused by called methods
findNext
public void findNext() throws xBaseJException, IOException
- used to get the next record in the Index list
when done the record pointer and field contents will be changed
- Throws: xBaseJException
- xBaseJ Index not opened or not part of the database
- Throws: IOException
- Java error caused by called methods
findPrev
public void findPrev() throws xBaseJException, IOException
- used to get the previous record in the Index list
when done the record pointer and field contents will be changed
- Throws: xBaseJException
- xBaseJ Index not opened or not part of the database
- Throws: IOException
- Java error caused by called methods
fldcount
public int fldcount()
- Returns:
- int the number of Fields in a database
reccount
public int reccount() throws xBaseJException, IOException
- Returns:
- int the number of records in a database
- Throws: xBaseJException
- logic error with server
- Throws: IOException
- logic error with server
read
public void read() throws xBaseJException, IOException
- used to read the next record, after the current record pointer, in the database
when done the record pointer and field contents will be changed
- Throws: xBaseJException
- usually the end of file condition
- Throws: IOException
- Java error caused by called methods
readPrev
public void readPrev() throws xBaseJException, IOException
- used to read the previous record, before the current record pointer, in the database
when done the record pointer and field contents will be changed
- Throws: xBaseJException
- usually the top of file condition
- Throws: IOException
- Java error caused by called methods
gotoRecord
public void gotoRecord(long recno) throws xBaseJException, IOException
- used to read a record at a particular place in the database
when done the record pointer and field contents will be changed
- Parameters:
- recno - the relative position of the record to read
- Throws: xBaseJException
- passed an negative number, 0 or value greater than the number of records in database
- Throws: IOException
- Java error caused by called methods
write
public void write() throws xBaseJException, IOException
- used to write a new record in the database
when done the record pointer is at the end of the database
- Throws: xBaseJException
- any one of several errors
- Throws: IOException
- Java error caused by called methods
update
public void update() throws xBaseJException, IOException
- updates the record at the current position
- Throws: xBaseJException
- any one of several errors
- Throws: IOException
- Java error caused by called methods
delete
public void delete() throws IOException, xBaseJException
- marks the current records as deleted
- Throws: xBaseJException
- usually occurs when no record has been read
- Throws: IOException
- Java error caused by called methods
undelete
public void undelete() throws IOException, xBaseJException
- marks the current records as not deleted
- Throws: xBaseJException
- usually occurs when no record has been read.
- Throws: IOException
- Java error caused by called methods
close
public void close() throws IOException, xBaseJException
- closes the database NOT FULLY IMPLEMENTED
- Throws: IOException
- Java error caused by called methods
- Throws: xBaseJException
- logic error with server
getField
public Field getField(int i) throws ArrayIndexOutOfBoundsException, xBaseJException
- Parameters:
- i - Field number
- Returns:
- Field object by its relative position
- Throws: xBaseJException
- usually occurs when Field number is less than 1 or greater than the number of Fields
- Throws: IOException
- Java error caused by called methods
getField
public Field getField(String name) throws xBaseJException, ArrayIndexOutOfBoundsException
- Parameters:
- name - Field name
- Returns:
- Field object by its name in the database
- Throws: xBaseJException
- Field name is not correct
- Throws: IOException
- Java error caused by called methods
getName
public String getName()
- Returns:
- String operating system name of the database
deleted
public boolean deleted() throws IOException, xBaseJException
- Returns:
- boolean true if record is marked for deletion
- Throws: xBaseJException
- logic error with server
- Throws: IOException
- logic error with server
All Packages Class Hierarchy This Package Previous Next Index