|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.accpac.sm.DBLink
@ThreadSafe public final class DBLink
Represents a database link or connection to a Sage Accpac ERP company or
system database.
An object of this class cannot be created directly by applications. Instead,
it should be obtained from the Program object's openDBLink
method.
The caller must call the dispose
method when finished with
the object so that all its resources can be released. The caller must not
call any other method on the object after calling dispose.
Nested Class Summary | |
---|---|
static class |
DBLink.DatabaseType
This class defines all the database types used by Accpac |
static class |
DBLink.LinkFlags
|
static class |
DBLink.LinkType
|
Method Summary | |
---|---|
void |
dispose()
Closes and releases all resources used by the object. |
protected void |
finalize()
overrides the finalize method of object so that the dispose gets called if it hasn't already |
Currency |
getCurrency(java.lang.String currencyCode)
Gets a Currency object representing the specified currency in the context of the program |
CurrencyRate |
getCurrencyRate(java.lang.String homeCurrency,
java.lang.String rateType,
java.lang.String sourceCurrency,
java.util.Date date)
Gets the exchange rate between the specified currencies |
CurrencyRate |
getCurrencyRateComposite(java.lang.String homeCurrency,
java.lang.String rateType,
java.lang.String sourceCurrency,
java.util.Date date)
Gets the composite exchange rate between the specified currencies |
CurrencyRate |
getCurrencyRateFloating(java.lang.String homeCurrency,
java.lang.String rateType,
java.lang.String sourceCurrency,
java.util.Date date)
Gets the floating exchange rate between the specified currencies, that is the exchange rate between the block master currencies (or the actual currency if it is not a member of a currency block). |
CurrencyTable |
getCurrencyTable(java.lang.String currency,
java.lang.String type)
gets a new CurrencyTable object for the given currency and type |
DBLink.DatabaseType |
getDatabaseType()
Return the database type |
java.sql.ResultSet |
getDirectQuery(java.lang.String query)
gets a new ResultSet containing the result of running the query directly against the database. |
DBLink.LinkFlags |
getFlags()
gets the database flags used to open the link. |
Program |
getParent()
gets the Program object that is the parent of this object |
DBTableMetaData |
getTableMetaData(java.lang.String tableName)
Get table meta data by calling native A4WAPIs |
int |
getTransactionLevel()
Gets the current transaction level on the current database connection |
DBLink.LinkType |
getType()
gets the type of database that the link connects to |
boolean |
isPermitted(java.lang.String resource)
returns whether or not the user is permitted to access the given security resource. |
View |
openView(java.lang.String viewid)
open an Accpac view |
View |
openView(java.lang.String viewid,
int modes,
int prefetch,
int directives)
open an Accpac view. |
int |
transactionBegin()
Begins a transaction on the current database connection |
int |
transactionCommit()
Commits the most recent transaction on the current database connection |
int |
transactionRollback()
Rolls back the most recent transaction on the current database connection |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void dispose()
public Currency getCurrency(java.lang.String currencyCode)
currencyCode
- the code of the currency to be retrieved. The code must consist
only of valid ASCII characters.
java.lang.NullPointerException
- if the program has been disposed of
java.lang.IllegalArgumentException
- if the code does not represent a currency in the program's datapublic CurrencyRate getCurrencyRate(java.lang.String homeCurrency, java.lang.String rateType, java.lang.String sourceCurrency, java.util.Date date)
homeCurrency
- home (functional) currency coderateType
- currency rate type codesourceCurrency
- source currency codedate
- date for which the exchange rate should be found
public CurrencyRate getCurrencyRateComposite(java.lang.String homeCurrency, java.lang.String rateType, java.lang.String sourceCurrency, java.util.Date date)
homeCurrency
- home (functional) currency coderateType
- currency rate type codesourceCurrency
- source currency codedate
- date for which the exchange rate should be found
public CurrencyRate getCurrencyRateFloating(java.lang.String homeCurrency, java.lang.String rateType, java.lang.String sourceCurrency, java.util.Date date)
homeCurrency
- home (functional) currency coderateType
- currency rate type codesourceCurrency
- source currency codedate
- date for which the exchange rate should be found
java.lang.NullPointerException
- if dispose()
has been called on the program
java.lang.IllegalArgumentException
- if the currency table for the home block master currency and
rate code is found but it does not contain exchange rate
information for the source block master currency
A4wapiGenericError
- if the currency table for the home block master currency and
rate code is not found (or some other error occurs)public CurrencyTable getCurrencyTable(java.lang.String currency, java.lang.String type)
public java.sql.ResultSet getDirectQuery(java.lang.String query)
public Program getParent()
public int getTransactionLevel()
DBLinkException
- If a database error occurs.public DBLink.LinkFlags getFlags()
public DBLink.LinkType getType()
public boolean isPermitted(java.lang.String resource)
resource
- the name of the resource to be checked. This must consist of
only ASCII printable characters at may be at most 10 characters
long.
public View openView(java.lang.String viewid, int modes, int prefetch, int directives)
...
- The parameters are as for the
View constructor
.
public View openView(java.lang.String viewid)
viewid
- the rotoid of the view to open
public int transactionBegin()
DBLinkException
- If a database error occurs.public int transactionCommit()
java.lang.IllegalStateException
- If the connection is not currently in a transaction
DBLinkException
- If a database error occurspublic int transactionRollback()
DBLinkException
- If a database error occurs.public DBTableMetaData getTableMetaData(java.lang.String tableName)
tableName
- - the name of an ACCPAC database table
DBLinkException
- If a database error occurspublic DBLink.DatabaseType getDatabaseType()
protected void finalize()
finalize
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |