All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xBaseJ.Client.DBF

java.lang.Object
   |
   +----xBaseJ.Client.DBF

public class DBF
extends Object

Constructor Index

 o DBF(String, String, int)
opens a DBF at the server

Method Index

 o close()
closes the database NOT FULLY IMPLEMENTED
 o delete()
marks the current records as deleted
 o deleted()
 o 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
 o findNext()
used to get the next record in the Index list when done the record pointer and field contents will be changed
 o findPrev()
used to get the previous record in the Index list when done the record pointer and field contents will be changed
 o fldcount()
Deprecated.
 o getCurrentRecordNumber()
 o getField(int)
 o getField(String)
 o getFieldCount()
 o getName()
 o getRecordCount()
 o 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
 o 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
 o 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
 o reccount()
Deprecated.
 o recno()
Deprecated.
 o setLock(boolean)
locks/unlocks the whole table
 o setRecordLock(boolean)
locks/unlocks the current record.
 o undelete()
marks the current records as not deleted
 o update()
updates the record at the current position
 o useIndex(String)
opens an index associated with the database
 o write()
used to write a new record in the database when done the record pointer is at the end of the database

Constructors

 o 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

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o fldcount
 public int fldcount()
Note: fldcount() is deprecated. use getFieldCount

Returns:
int the number of Fields in a database
 o recno
 public int recno()
Note: recno() is deprecated. use getCurrentRecordNumber

Returns:
int the current record number
 o reccount
 public int reccount() throws xBaseJException, IOException
Note: reccount() is deprecated. use getRecordCount

Returns:
int the number of records in a database
Throws: xBaseJException
logic error with server
Throws: IOException
logic error with server
 o getFieldCount
 public int getFieldCount()
Returns:
int the number of Fields in a database
 o getCurrentRecordNumber
 public int getCurrentRecordNumber()
Returns:
int the current record number
 o getRecordCount
 public int getRecordCount() throws xBaseJException, IOException
Returns:
int the number of records in a database
Throws: xBaseJException
logic error with server
Throws: IOException
logic error with server
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o getName
 public String getName()
Returns:
String operating system name of the database
 o 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