MDi JLib
1.7.4

com.microdeveloper.data
Interface SQLSet


public interface SQLSet

An object that defines an encapsulated connection, statement and records.

A query is performed with establishes the basic set of data available to the object.  The object may also use the sql to perform updates on the target of the data by changing only the arguments passed to the object.  The sql need only be set once for a particular set of data or update target and modified as necessary through the use of the said arguments to the statement.

Data may be accessed generically as an Object or as a primitive type such as int and may be addressed by simple name or by index position.  This pertains to both records and columns within the record.

Once the data is established, full meta-data related to the connection is also available from the object. This is beneficial when many objects are created with varying connections to possibly different types of databases.

Revision History
Version 1.0 Jan 19, 2005 Created (SQLDataSet for Oracle only)
Version 1.1 Feb 24, 2005 Added connection pool compatibility and bug fixes to primitive return types
Version 1.2 Mar 06, 2005 Added compatibility with MySQL by removing Oracle specific types and navigation
Version 1.3 Apr 16, 2005 Added update capability, deprecated SQLDataSet, replaced setData with query, added single parameter calls Version 1.4 Oct 10, 2005 Added constants for list types, added as String for backward compatibility Version 1.5 Sep 24, 2006 Added discreet commit processing compatibility

Version:
1.5
Author:
MicroDeveloper, Inc.

Field Summary
static String ARG_NAMES_TYPE
          Argument Names List Type constant
static String ARG_TYPES_TYPE
          Argument Types List Type constant
static String ARG_VALUES_TYPE
          Argument Values List Type constant
static boolean OFF
          Boolean 'Off'
static boolean ON
          Boolean 'On'
static String PROP_CONN
          SQL connection property
static String PROP_SQL
          SQL to be executed property
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void afterLast()
           
 void beforeFirst()
           
 void clearArgs()
           
 void close()
           
 boolean doCommit()
           
 boolean doRollback()
           
 boolean doRollback(Savepoint sp)
           
 void finalize()
           
 void first()
           
 ArrayList getArguments(String type)
           
 boolean getAutoCommit()
           
 boolean getAutoRollback()
           
 BigDecimal getBigDecimal(String columnName)
           
 Blob getBlob(String columnName)
           
 Clob getClob(String columnName)
           
 int getColumnCount()
           
 String getColumnName(int i)
           
 String[] getColumnNames()
           
 int getColumnPosition(String columnName)
           
 String getColumnType(int i)
           
 String getColumnType(String columnName)
           
 boolean getCommitting()
           
 Connection getConnection()
           
 String getConnectionURL()
           
 Connection getConnProperty()
           
 int getCurrentRow()
           
 Date getDate(String columnName)
           
 Date getDate(String columnName, Calendar cal)
           
 double getDouble(String columnName)
           
 float getFloat(String columnName)
           
 int getInt(String columnName)
           
 Object getObject(int i)
           
 Object getObject(int row, int column)
           
 Object getObject(int row, String columnName)
           
 Object getObject(String columnName)
           
 ResultSet getResultSet()
           
 int getRow()
           
 int getRowCount()
           
 int getSize()
           
 String getSql()
           
 String getSqlProperty()
           
 String getString(String columnName)
           
 String getTableName(int i)
           
 Time getTime(String columnName)
           
 Time getTime(String columnName, Calendar cal)
           
 boolean hasData()
           
 boolean isEmpty()
           
 void last()
           
 boolean next()
           
 void nextRecord()
           
 boolean previous()
           
 void previousRecord()
           
 void query()
           
 void query(Connection conn, String sql)
           
 void query(Connection conn, String sql, String[] args)
           
 void query(String sql)
           
 void query(String[] args)
           
 void query(String sql, String[] args)
           
 void releaseSavepoint(Savepoint sp)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void setArg(String arg)
           
 void setArgs(String[] args)
           
 void setArguments(ArrayList nameList, ArrayList typeList, ArrayList valueList)
           
 void setAutoCommit(boolean state)
           
 void setAutoRollback(boolean state)
           
 void setCommitting(boolean state)
           
 void setConnection(Connection c)
           
 void setConnProperty(Connection value)
           
 void setCurrentRow(int i)
           
 void setRowCount()
           
 Savepoint setSavePoint()
           
 Savepoint setSavePoint(String s)
           
 void setSql(String s)
           
 void setSqlProperty(String value)
           
 Object[][] toObjectArray()
           
 String[][] toStringArray()
           
 int update()
           
 int update(Connection conn, String sql)
           
 int update(Connection conn, String sql, String[] args)
           
 int update(String[] args)
           
 int update(String sql, String[] args)
           
 

Field Detail

ARG_NAMES_TYPE

static final String ARG_NAMES_TYPE
Argument Names List Type constant

See Also:
Constant Field Values

ARG_TYPES_TYPE

static final String ARG_TYPES_TYPE
Argument Types List Type constant

See Also:
Constant Field Values

ARG_VALUES_TYPE

static final String ARG_VALUES_TYPE
Argument Values List Type constant

See Also:
Constant Field Values

ON

static final boolean ON
Boolean 'On'

See Also:
Constant Field Values

OFF

static final boolean OFF
Boolean 'Off'

See Also:
Constant Field Values

PROP_CONN

static final String PROP_CONN
SQL connection property

See Also:
Constant Field Values

PROP_SQL

static final String PROP_SQL
SQL to be executed property

See Also:
Constant Field Values
Method Detail

finalize

void finalize()
              throws Throwable
Throws:
Throwable

getArguments

ArrayList getArguments(String type)

toObjectArray

Object[][] toObjectArray()

toStringArray

String[][] toStringArray()

getConnection

Connection getConnection()

getConnectionURL

String getConnectionURL()
                        throws SQLException
Throws:
SQLException

getColumnPosition

int getColumnPosition(String columnName)

getTableName

String getTableName(int i)

getString

String getString(String columnName)
                 throws SQLException
Throws:
SQLException

getInt

int getInt(String columnName)
           throws SQLException
Throws:
SQLException

getDate

Date getDate(String columnName)
             throws SQLException
Throws:
SQLException

getFloat

float getFloat(String columnName)
               throws SQLException
Throws:
SQLException

getBigDecimal

BigDecimal getBigDecimal(String columnName)
                         throws Exception
Throws:
Exception

getBlob

Blob getBlob(String columnName)
             throws SQLException
Throws:
SQLException

getDate

Date getDate(String columnName,
             Calendar cal)
             throws Exception
Throws:
Exception

getTime

Time getTime(String columnName,
             Calendar cal)
             throws Exception
Throws:
Exception

getTime

Time getTime(String columnName)
             throws SQLException
Throws:
SQLException

getDouble

double getDouble(String columnName)
                 throws SQLException
Throws:
SQLException

getClob

Clob getClob(String columnName)
             throws SQLException
Throws:
SQLException

getColumnType

String getColumnType(String columnName)
                     throws SQLException
Throws:
SQLException

beforeFirst

void beforeFirst()
                 throws SQLException
Throws:
SQLException

afterLast

void afterLast()
               throws SQLException
Throws:
SQLException

next

boolean next()
             throws SQLException
Throws:
SQLException

nextRecord

void nextRecord()
                throws SQLException
Throws:
SQLException

previous

boolean previous()
                 throws SQLException
Throws:
SQLException

previousRecord

void previousRecord()
                    throws SQLException
Throws:
SQLException

first

void first()
           throws SQLException
Throws:
SQLException

last

void last()
          throws SQLException
Throws:
SQLException

getObject

Object getObject(int row,
                 int column)
                 throws SQLException
Throws:
SQLException

getObject

Object getObject(int row,
                 String columnName)
                 throws SQLException
Throws:
SQLException

getObject

Object getObject(String columnName)
                 throws SQLException
Throws:
SQLException

getObject

Object getObject(int i)
                 throws SQLException
Throws:
SQLException

getResultSet

ResultSet getResultSet()

setConnection

void setConnection(Connection c)
                   throws SQLException
Throws:
SQLException

getSize

int getSize()

getColumnNames

String[] getColumnNames()

getColumnCount

int getColumnCount()

getColumnType

String getColumnType(int i)

isEmpty

boolean isEmpty()

setArgs

void setArgs(String[] args)

setArguments

void setArguments(ArrayList nameList,
                  ArrayList typeList,
                  ArrayList valueList)

close

void close()
           throws SQLException
Throws:
SQLException

clearArgs

void clearArgs()

setArg

void setArg(String arg)

setSql

void setSql(String s)

getSql

String getSql()

hasData

boolean hasData()

setCurrentRow

void setCurrentRow(int i)
                   throws SQLException
Throws:
SQLException

getCurrentRow

int getCurrentRow()

getRow

int getRow()

getRowCount

int getRowCount()

getColumnName

String getColumnName(int i)

query

void query()
           throws SQLException
Throws:
SQLException

query

void query(String sql)
           throws SQLException
Throws:
SQLException

query

void query(String[] args)
           throws SQLException
Throws:
SQLException

query

void query(String sql,
           String[] args)
           throws SQLException
Throws:
SQLException

query

void query(Connection conn,
           String sql,
           String[] args)
           throws SQLException
Throws:
SQLException

query

void query(Connection conn,
           String sql)
           throws SQLException
Throws:
SQLException

getSqlProperty

String getSqlProperty()

setSqlProperty

void setSqlProperty(String value)

getConnProperty

Connection getConnProperty()

setRowCount

void setRowCount()

setConnProperty

void setConnProperty(Connection value)
                     throws SQLException
Throws:
SQLException

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener listener)

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener listener)

update

int update()
           throws SQLException
Throws:
SQLException

update

int update(String[] args)
           throws SQLException
Throws:
SQLException

update

int update(String sql,
           String[] args)
           throws SQLException
Throws:
SQLException

update

int update(Connection conn,
           String sql)
           throws SQLException
Throws:
SQLException

update

int update(Connection conn,
           String sql,
           String[] args)
           throws SQLException
Throws:
SQLException

setAutoCommit

void setAutoCommit(boolean state)

setCommitting

void setCommitting(boolean state)

setAutoRollback

void setAutoRollback(boolean state)

doCommit

boolean doCommit()

doRollback

boolean doRollback(Savepoint sp)

doRollback

boolean doRollback()

getAutoCommit

boolean getAutoCommit()

getCommitting

boolean getCommitting()

getAutoRollback

boolean getAutoRollback()

setSavePoint

Savepoint setSavePoint()

setSavePoint

Savepoint setSavePoint(String s)

releaseSavepoint

void releaseSavepoint(Savepoint sp)

MDi JLib
1.7.4

Copyright©2001-2007 MicroDeveloper, Inc. All Rights Reserved.