|
ElegantJCharts Java API Specification v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.elegantj.data.dataprovider.AbstractDataProvider
|
+--com.elegantj.data.dataprovider.sql.SqlDataProvider
This class encapsulates functionality of an SQL data provider.
The basic functionality can be summarized as follows:
- Retrieves the data from the Database.
- Saves the data to the Database.
This bean provides powerful designing aspects by providing following user friendly property
DataProvider the data provider
Connection the database connection
ConnectionProperties the connection properties (url, driver, username, password)
SqlString the sql query string
AllowUpdate indicates whether the data will be updated
UpdatetableTable the updateable table name
UpdateableColumns the updateable columns
UniqueColumns the unique columns
WhereClause indicates which columns are used to build the where clause
KeyModification indicates the process to update the data
SortCriteria the criteria for sorting the data
FilterCriteria the criteria for filtering the data
FilterState indicates whether the filter criteria is applied or not
SaveOnlyFilteredData indicates to save only filtered rows or all rows
FetchSize the maximum number of rows which can be retrieved
AppendDataOnFetchNext indicates whether the next fetched data is appended or replaced to existing data
SkippedRows the total number of rows to be skipped
| Field Summary | |
static int |
UNIQUE
Indicates that use only unique columns in the where clause |
static int |
UNIQUE_AND_MODIFIED
Indicates that use only unique and modified columns in the where clause |
static int |
UNIQUE_AND_UPDATEABLE
Indicates that use only unique and updateable columns in the where clause |
static int |
USE_DELETE_THEN_INSERT
Indicates that update the data by deleting and inserting it |
static int |
USE_UPDATE
Indicates that update the data by updating |
| Fields inherited from class com.elegantj.data.dataprovider.AbstractDataProvider |
c11, changes, clientTable, columnNames, currentIndex, dataTable |
| Constructor Summary | |
SqlDataProvider()
|
|
| Method Summary | |
boolean |
close()
Closes the database connection and statement |
boolean |
executeQuery(java.lang.String sqlQuery)
Executes the sql query |
protected void |
finalize()
|
boolean |
getAllowUpdate()
Returns true if the data can be updated |
java.util.Vector |
getColumnAttribs()
Returns the vector containing the ColumnAttribs objects which represents the column attributes |
int |
getColumnIndex(java.lang.String colName)
Returns the index of the column colName |
int |
getColumnType(int colIndex)
Returns the type of the column at the specified index |
java.sql.Connection |
getConnection()
Gets the connection |
com.elegantj.data.editors.ConnectionProperties |
getConnectionProperties()
Gets the connection properties |
int |
getKeyModification()
Gets the modification option which used to update the data |
java.lang.String |
getSqlString()
Gets the sql query string |
int |
getTableCount()
Returns the total number of tables |
java.util.Vector |
getTableNames()
Returns the table names |
java.lang.String |
getUniqueColumns()
Gets the unique columns |
java.lang.String |
getUpdateableColumns()
Gets the updateable columns |
java.lang.String |
getUpdateableTable()
Gets the updateable table name |
int |
getWhereClause()
Gets the where clause option which used to bulid the where clause |
boolean |
isFetchNext()
Determines whether fetching the next rows or not |
boolean |
nextData()
If more data can be fetched, it fetches and return true, otherwise return false |
boolean |
open()
Opens the database connection and creates the statement |
void |
readExternal(java.io.ObjectInput in)
|
void |
refreshQuery()
Refresh the sql query |
void |
retrieve()
Retrives the data |
void |
retrieve(java.lang.String[] str)
Retrives the data |
void |
save()
Saves the transaction |
boolean |
saveModifications()
Saves the modifications |
void |
setAllowUpdate(boolean b)
Allows the data to be updated |
void |
setConnection(java.sql.Connection conn)
Sets the connection |
void |
setConnectionProperties(com.elegantj.data.editors.ConnectionProperties connProp)
Sets the connection properties url, driver, user name, password |
void |
setKeyModification(int key)
Sets the modification option which used to update the data |
void |
setSqlString(java.lang.String str)
Sets the sql query string |
void |
setUniqueColumns(java.lang.String columns)
Sets the unique columns |
void |
setUniqueKeys(java.util.Vector vector)
Deprecated. |
void |
setUpdateable(java.util.Vector vector)
Deprecated. |
void |
setUpdateableColumns(java.lang.String columns)
Sets the updateable columns |
void |
setUpdateableTable(java.lang.String updateTable)
Sets the updateable table name |
void |
setWhereClause(int criteria)
Sets the where clause option which used to bulid the where clause |
void |
writeExternal(java.io.ObjectOutput out)
Externalizable interface implementation to save and retrieve the state of this bean |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int UNIQUE
public static final int UNIQUE_AND_UPDATEABLE
public static final int UNIQUE_AND_MODIFIED
public static final int USE_DELETE_THEN_INSERT
public static final int USE_UPDATE
| Constructor Detail |
public SqlDataProvider()
| Method Detail |
public void setConnectionProperties(com.elegantj.data.editors.ConnectionProperties connProp)
connProp - the ConnectionProperties objectpublic com.elegantj.data.editors.ConnectionProperties getConnectionProperties()
public void setConnection(java.sql.Connection conn)
throws java.sql.SQLException
conn - the connection
java.sql.SQLExceptionpublic java.sql.Connection getConnection()
public void setSqlString(java.lang.String str)
str - the query stringpublic java.lang.String getSqlString()
public void refreshQuery()
public void setWhereClause(int criteria)
criteria - one of the constants : UNIQUE, UNIQUE_UPDATEABLE, UNIQUE_MODIFIEDpublic int getWhereClause()
public void setKeyModification(int key)
key - one of the constants : USE_DELETE_THEN_INSERT, USE_UPDATEpublic int getKeyModification()
public void setAllowUpdate(boolean b)
b - if true, the data will be updatedpublic boolean getAllowUpdate()
public void setUpdateableTable(java.lang.String updateTable)
updateTable - the name of the table which can be updatedpublic java.lang.String getUpdateableTable()
public void setUpdateableColumns(java.lang.String columns)
columns - the string which contains comma separated index of the updateable columnspublic java.lang.String getUpdateableColumns()
public void setUpdateable(java.util.Vector vector)
public void setUniqueColumns(java.lang.String columns)
columns - the string which contains comma separated index of the unique columnspublic java.lang.String getUniqueColumns()
public void setUniqueKeys(java.util.Vector vector)
public boolean executeQuery(java.lang.String sqlQuery)
sqlQuery - the sql query to be executed
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic boolean open()
public boolean close()
public java.util.Vector getColumnAttribs()
public int getColumnIndex(java.lang.String colName)
getColumnIndex in interface DataProvidergetColumnIndex in class AbstractDataProvidercolName - the name of the column
public int getColumnType(int colIndex)
getColumnType in interface DataProvidergetColumnType in class AbstractDataProvidercolIndex - the index of the column
public int getTableCount()
public java.util.Vector getTableNames()
public void retrieve(java.lang.String[] str)
str - the array of the argumentspublic void retrieve()
public void save()
public boolean saveModifications()
saveModifications in class AbstractDataProviderpublic boolean nextData()
public boolean isFetchNext()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class AbstractDataProviderjava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class AbstractDataProviderjava.io.IOException
java.lang.ClassNotFoundException
|
ElegantJCharts Java API Specification v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||