org.apache.ojb.broker.accesslayer
Interface JdbcAccess

All Known Implementing Classes:
JdbcAccessImpl

public interface JdbcAccess

JdbcAccess is responsible for establishing performing SQL Queries against remote Databases. It hides all knowledge about JDBC from the PersistenceBroker

Version:
$Id: JdbcAccess.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler, Armin Waibel

Method Summary
 void executeDelete(ClassDescriptor cld, java.lang.Object obj)
          performs a DELETE operation against RDBMS.
 void executeDelete(Query query, ClassDescriptor cld)
          performs a DELETE operation based on the given Query against RDBMS.
 void executeInsert(ClassDescriptor cld, java.lang.Object obj)
          performs an INSERT operation against RDBMS.
 ResultSetAndStatement executeQuery(Query query, ClassDescriptor cld)
          performs a SELECT operation against RDBMS.
 ResultSetAndStatement executeSQL(java.lang.String sqlStatement, ClassDescriptor cld, boolean scrollable)
          performs a SQL SELECT statement against RDBMS.
 ResultSetAndStatement executeSQL(java.lang.String sqlStatement, ClassDescriptor cld, ValueContainer[] values, boolean scrollable)
          performs a SQL SELECT statement against RDBMS.
 void executeUpdate(ClassDescriptor cld, java.lang.Object obj)
          performs an UPDATE operation against RDBMS.
 int executeUpdateSQL(java.lang.String sqlStatement, ClassDescriptor cld)
          performs a SQL UPDTE, INSERT or DELETE statement against RDBMS.
 int executeUpdateSQL(java.lang.String sqlStatement, ClassDescriptor cld, ValueContainer[] values1, ValueContainer[] values2)
          performs a SQL UPDTE, INSERT or DELETE statement against RDBMS.
 java.lang.Object materializeObject(ClassDescriptor cld, Identity oid)
          performs a primary key lookup operation against RDBMS and materializes an object from the resulting row.
 

Method Detail

executeDelete

void executeDelete(ClassDescriptor cld,
                   java.lang.Object obj)
                   throws PersistenceBrokerException
performs a DELETE operation against RDBMS.

Parameters:
cld - ClassDescriptor providing mapping information.
obj - The object to be deleted.
Throws:
PersistenceBrokerException

executeDelete

void executeDelete(Query query,
                   ClassDescriptor cld)
                   throws PersistenceBrokerException
performs a DELETE operation based on the given Query against RDBMS.

Parameters:
query - the query string.
cld - ClassDescriptor providing JDBC information.
Throws:
PersistenceBrokerException

executeInsert

void executeInsert(ClassDescriptor cld,
                   java.lang.Object obj)
                   throws PersistenceBrokerException
performs an INSERT operation against RDBMS.

Parameters:
obj - The Object to be inserted as a row of the underlying table.
cld - ClassDescriptor providing mapping information.
Throws:
PersistenceBrokerException

executeSQL

ResultSetAndStatement executeSQL(java.lang.String sqlStatement,
                                 ClassDescriptor cld,
                                 boolean scrollable)
                                 throws PersistenceBrokerException
performs a SQL SELECT statement against RDBMS.

Parameters:
sqlStatement - the query string.
cld - ClassDescriptor providing meta-information.
scrollable - Does this resultset need cursor control for operations like last, first and size
Throws:
PersistenceBrokerException

executeSQL

ResultSetAndStatement executeSQL(java.lang.String sqlStatement,
                                 ClassDescriptor cld,
                                 ValueContainer[] values,
                                 boolean scrollable)
                                 throws PersistenceBrokerException
performs a SQL SELECT statement against RDBMS.

Parameters:
sqlStatement - the query string.
cld - ClassDescriptor providing meta-information.
values - The set of values to bind to the statement (may be null)
scrollable - Does this resultset need cursor control for operations like last, first and size
Throws:
PersistenceBrokerException

executeUpdateSQL

int executeUpdateSQL(java.lang.String sqlStatement,
                     ClassDescriptor cld)
                     throws PersistenceBrokerException
performs a SQL UPDTE, INSERT or DELETE statement against RDBMS.

Parameters:
sqlStatement - the query string.
cld - ClassDescriptor providing meta-information.
Returns:
int returncode
Throws:
PersistenceBrokerException

executeUpdateSQL

int executeUpdateSQL(java.lang.String sqlStatement,
                     ClassDescriptor cld,
                     ValueContainer[] values1,
                     ValueContainer[] values2)
                     throws PersistenceBrokerException
performs a SQL UPDTE, INSERT or DELETE statement against RDBMS.

Parameters:
sqlStatement - the query string.
cld - ClassDescriptor providing meta-information.
values1 - The first set of values to bind to the statement (may be null)
values2 - The second set of values to bind to the statement (may be null)
Returns:
int returncode
Throws:
PersistenceBrokerException

executeUpdate

void executeUpdate(ClassDescriptor cld,
                   java.lang.Object obj)
                   throws PersistenceBrokerException
performs an UPDATE operation against RDBMS.

Parameters:
obj - The Object to be updated in the underlying table.
cld - ClassDescriptor providing mapping information.
Throws:
PersistenceBrokerException

materializeObject

java.lang.Object materializeObject(ClassDescriptor cld,
                                   Identity oid)
                                   throws PersistenceBrokerException
performs a primary key lookup operation against RDBMS and materializes an object from the resulting row. Only skalar attributes are filled from the row, references are not resolved.

Parameters:
oid - contains the primary key info.
cld - ClassDescriptor providing mapping information.
Returns:
the materialized object, null if no matching row was found or if any error occured.
Throws:
PersistenceBrokerException

executeQuery

ResultSetAndStatement executeQuery(Query query,
                                   ClassDescriptor cld)
                                   throws PersistenceBrokerException
performs a SELECT operation against RDBMS.

Parameters:
query - the query string.
cld - ClassDescriptor providing JDBC information.
Throws:
PersistenceBrokerException


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30