All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xBaseJ.DBF

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

public class DBF
extends Object

Variable Index

 o DBASEIII
 o DBASEIV
 o READ_ONLY

Constructor Index

 o DBF(String)
creates an DBF object and opens existing database file in read/write mode

The unregistered package limitted to 5 open dbf's.

 o DBF(String, boolean)
creates a new DBF file or replaces an existing database file, w/o format assumes dbaseiii file format

The unregistered package limitted to 5 open dbf's.

 o DBF(String, char)
creates an DBF object and opens existing database file in readonly mode

The unregistered package limitted to 5 open dbf's.

 o DBF(String, int, boolean)
creates a new DBF file or replaces an existing database file

The unregistered package limitted to 5 open dbf's.

Method Index

 o addField(Field)
adds a new Field to a database
 o addField(Field[])
adds an array of new Fields to a database
 o changeField(Field, Field)
changes a Field in a database NOT FULLY IMPLEMENTED
 o close()
closes the database
 o createIndex(String, String, boolean)
creates a new Index as a NDX file, assumes NDX file does not exist
 o createIndex(String, String, boolean, boolean)
creates a new Index as a NDX file
 o createTag(String, String, boolean)
creates a tag in the MDX file
 o delete()
marks the current records as deleted
 o deleted()
returns true if record is marked for deletion
 o dropField(Field)
removes a Field from a database NOT FULLY IMPLEMENTED
 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()
returns the number of fields in a database Deprecated.
 o getCurrentRecordNumber()
returns the current record number
 o getField(int)
returns a Field object by its relative position
 o getField(String)
returns a Field object by its name in the database
 o getFieldCount()
returns the number of fields in a database
 o getIndex(int)
gets an Index object associated with the database.
 o getIndexCount()
returns the number of known index files and tags
 o getName()
returns the full path name of the database
 o getRecordCount()
returns the number of records in a database
 o gotoRecord(int)
used to read a record at a particular place in the database when done the record pointer and field contents will be changed
 o pack()
packs a DBF by removing deleted records and memo fields
 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()
returns the number of records in a database Deprecated.
 o recno()
returns the current record number Deprecated.
 o setFieldEvaluation(String)
 o startBottom()
used to position record pointer at the last record or index in the database when done the record pointer will be changed.
 o startTop()
used to position record pointer at the first record or index in the database when done the record pointer will be changed.
 o undelete()
marks the current records as not deleted
 o update()
updates the record at the current position
 o useIndex(Index)
used to indicate the primary Index
 o useIndex(String)
opens an Index file associated with the database.
 o useIndex(String, String)
opens an Index file associated with the database
 o useIndexByID(String)
used to indicate the primary Index
 o useTag(String)
associates all Index operations with an existing tag
 o useTag(String, String)
associates all Index operations with an existing tag
 o version()
 o write()
used to write a new record in the database when done the record pointer is at the end of the database

Variables

 o DBASEIII
 public static final byte DBASEIII
 o DBASEIV
 public static final byte DBASEIV
 o READ_ONLY
 public static final char READ_ONLY

Constructors

 o DBF
 public DBF(String DBFname,
            boolean destroy) throws xBaseJException, IOException, SecurityException
creates a new DBF file or replaces an existing database file, w/o format assumes dbaseiii file format

The unregistered package limitted to 5 open dbf's.

Parameters:
DBFname - a new or existing database file, can be full or partial pathname
format - use class constants DBASEIII or DBASEIV
Throws: xBaseJException
File does exist and told not to destroy it.
Throws: xBaseJException
Told to destroy but operating system can not destroy
Throws: SecurityException
Java error caused by called methods, most likely trying to create on a remote system
 o DBF
 public DBF(String DBFname,
            int format,
            boolean destroy) throws xBaseJException, IOException, SecurityException
creates a new DBF file or replaces an existing database file

The unregistered package limitted to 5 open dbf's.

Parameters:
DBFname - a new or existing database file, can be full or partial pathname
format - use class constants DBASEIII or DBASEIV
destroy - permission to destroy an existing database file
Throws: xBaseJException
File does exist and told not to destroy it.
Throws: xBaseJException
Told to destroy but operating system can not destroy
Throws: SecurityException
Java error caused by called methods, most likely trying to create on a remote system
 o DBF
 public DBF(String DBFname,
            char readOnly) throws xBaseJException, IOException
creates an DBF object and opens existing database file in readonly mode

The unregistered package limitted to 5 open dbf's.

Parameters:
DBFname - an existing database file, can be full or partial pathname
Throws: xBaseJException
Can not find database
Throws: xBaseJException
database not dbaseIII format
 o DBF
 public DBF(String DBFname) throws xBaseJException, IOException
creates an DBF object and opens existing database file in read/write mode

The unregistered package limitted to 5 open dbf's.

Parameters:
DBFname - an existing database file, can be full or partial pathname
Throws: xBaseJException
Can not find database
Throws: xBaseJException
database not dbaseIII format

Methods

 o version
 public String version()
 o addField
 public void addField(Field aField) throws xBaseJException, IOException
adds a new Field to a database

Parameters:
aField - a predefined Field object
Throws: xBaseJException
xBaseJ error caused by called methods
See Also:
Field
 o addField
 public void addField(Field aField[]) throws xBaseJException, IOException
adds an array of new Fields to a database

Parameters:
aField - an array of predefined Field object
Throws: xBaseJException
passed an empty array or other error
See Also:
Field
 o dropField
 public void dropField(Field aField) throws xBaseJException, IOException
removes a Field from a database NOT FULLY IMPLEMENTED

Parameters:
aField - a field in the database
Throws: xBaseJException
Field is not part of the database
See Also:
Field
 o changeField
 public void changeField(Field oldField,
                         Field newField) throws xBaseJException, IOException
changes a Field in a database NOT FULLY IMPLEMENTED

Parameters:
aField - a Field object
Throws: xBaseJException
xBaseJ error caused by called methods
See Also:
Field
 o fldcount
 public int fldcount()
Note: fldcount() is deprecated. use getFieldCount

returns the number of fields in a database

 o reccount
 public int reccount()
Note: reccount() is deprecated. use getRecordCount

returns the number of records in a database

 o recno
 public int recno()
Note: recno() is deprecated. use getCurrentRecordNumber

returns the current record number

 o getFieldCount
 public int getFieldCount()
returns the number of fields in a database

 o getRecordCount
 public int getRecordCount()
returns the number of records in a database

 o getCurrentRecordNumber
 public int getCurrentRecordNumber()
returns the current record number

 o getIndexCount
 public int getIndexCount()
returns the number of known index files and tags

 o getIndex
 public Index getIndex(int indexPosition) throws xBaseJException
gets an Index object associated with the database. This index does not become the primary index. Written for the makeDBFBean application. Position is relative to 1.

Parameters:
int - index position
Throws: xBaseJException
index value incorrect
 o useIndex
 public Index useIndex(String filename) throws xBaseJException, IOException
opens an Index file associated with the database. This index becomes the primary index used in subsequent find methods.

Parameters:
filename - an existing ndx file(can be full or partial pathname) or mdx tag
Throws: xBaseJException
xBaseJ Fields defined in index do not match fields in database
 o useIndex
 public Index useIndex(String filename,
                       String ID) throws xBaseJException, IOException
opens an Index file associated with the database

Parameters:
filename - an existing Index file, can be full or partial pathname
ID - a unique id to define Index at run-time.
Throws: xBaseJException
xBaseJ Fields defined in Index do not match Fields in database
 o useIndex
 public Index useIndex(Index ndx) throws xBaseJException, IOException
used to indicate the primary Index

Parameters:
Index - a Index object
Throws: xBaseJException
xBaseJ Index not opened or not part of the database
 o useIndexByID
 public Index useIndexByID(String ID) throws xBaseJException
used to indicate the primary Index

Parameters:
Index - a string id
Throws: xBaseJException
xBaseJ Index not opened or not part of the database
See Also:
useIndex
 o useTag
 public Index useTag(String tagname) throws xBaseJException
associates all Index operations with an existing tag

Parameters:
tagname - an existing tag name in the production MDX file
Throws: xBaseJException
no MDX file tagname not found
 o useTag
 public Index useTag(String tagname,
                     String ID) throws xBaseJException, IOException
associates all Index operations with an existing tag

Parameters:
tagname - an existing tag name in the production MDX file
ID - a unique id to define Index at run-time.
Throws: xBaseJException
no MDX file tagname not found
 o createIndex
 public Index createIndex(String filename,
                          String index,
                          boolean unique) throws xBaseJException, IOException
creates a new Index as a NDX file, assumes NDX file does not exist

Parameters:
filename - a new Index file name
index - string identifying Fields used in Index
unique - boolean to indicate if the key is always unique
Throws: xBaseJException
NDX file already exists
 o createIndex
 public Index createIndex(String filename,
                          String index,
                          boolean destroy,
                          boolean unique) throws xBaseJException, IOException
creates a new Index as a NDX file

Parameters:
filename - a new Index file name
index - string identifying Fields used in Index
destroy - permission to destory NDX if file exists
unique - boolean to indicate if the key is always unique
Throws: xBaseJException
NDX file already exists
 o createTag
 public Index createTag(String tagname,
                        String tagIndex,
                        boolean unique) throws xBaseJException, IOException
creates a tag in the MDX file

Parameters:
tagname - a non-existing tag name in the production MDX file
tagIndex - string identifying Fields used in Index
unique - boolean to indicate if the key is always unique
Throws: xBaseJException
no MDX file tagname already exists
 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:
s boolean indicating if the record found contains the exact key
Throws: xBaseJException
xBaseJ no Indexs opened with database
 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 eof - end of file
 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 tof - top of file
 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
 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
 o gotoRecord
 public void gotoRecord(int 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
 o startTop
 public void startTop() throws xBaseJException, IOException
used to position record pointer at the first record or index in the database when done the record pointer will be changed. NO RECORD IS READ. Your program should follow this with either a read (for non-index reads) or findNext (for index processing)

Throws: xBaseJException
most likely no records in database
 o startBottom
 public void startBottom() throws xBaseJException, IOException
used to position record pointer at the last record or index in the database when done the record pointer will be changed. NO RECORD IS READ. Your program should follow this with either a read (for non-index reads) or findPrev (for index processing)

Throws: xBaseJException
most likely no records in database
 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
 o update
 public void update() throws xBaseJException, IOException
updates the record at the current position

Throws: xBaseJException
any one of several errors
 o delete
 public void delete() throws IOException, xBaseJException
marks the current records as deleted

Throws: xBaseJException
usually occurs when no record has been read
 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.
 o close
 public void close() throws IOException
closes the database

 o getField
 public Field getField(int i) throws ArrayIndexOutOfBoundsException, xBaseJException
returns a Field object by its relative position

Parameters:
i - Field number
Throws: xBaseJException
usually occurs when Field number is less than 1 or greater than the number of fields
 o getField
 public Field getField(String name) throws xBaseJException, ArrayIndexOutOfBoundsException
returns a Field object by its name in the database

Parameters:
name - Field name
Throws: xBaseJException
Field name is not correct
 o getName
 public String getName()
returns the full path name of the database

 o deleted
 public boolean deleted()
returns true if record is marked for deletion

 o pack
 public void pack() throws xBaseJException, IOException, SecurityException, CloneNotSupportedException
packs a DBF by removing deleted records and memo fields

Throws: xBaseJException
File does exist and told not to destroy it.
Throws: xBaseJException
Told to destroy but operating system can not destroy
Throws: CloneNotSupportedException
Java error caused by called methods
 o setFieldEvaluation
 public void setFieldEvaluation(String evalString) throws xBaseJException

All Packages  Class Hierarchy  This Package  Previous  Next  Index