|
OOP SimpleDaoHelper Version 1.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bentofw.dao.SimpleDaoHelperImpl
com.bentofw.dao.DaoHelperForJdbc
public class DaoHelperForJdbc
Implementation of SimpleDaoHelper interface. This
class creates PreparedStatement from JDBC Connection.
If the JNDI DataSource is available in your environment,
please use DaoHelperForJndi instead of this
implementation.
Most J2EE application servers implement the sophisticated
JNDI DataSource, and it will result in the better
performance than the plain JDBC Connection.
To use this implementation, all the information required
for establishing JDBC Connection should be supplied in
the property resource file.
This property resource file is:
| Property name | Value |
|---|---|
| jdbc_drv | The fully qualified class name of your JDBC driver |
| jdbc_url | The URL for the intended database |
| jdbc_usr | The user name for the specified database |
| jdbc_pss | The password for the specified database |
SimpleDaoHelper| Constructor Summary | |
|---|---|
DaoHelperForJdbc()
The constructor. |
|
| Method Summary | |
|---|---|
void |
closeResource(java.sql.ResultSet res,
java.sql.PreparedStatement ps,
java.sql.Connection con,
boolean isOK)
Close the specified ResultSet, PreparedStatment and Connection. |
java.sql.Connection |
getConnection()
Return the JDBC Connection. |
java.sql.PreparedStatement |
getPrepareStatement(java.sql.Connection con,
java.lang.String sql)
Return the JDBC PreparedStatement for the given SQL statement. |
| Methods inherited from class com.bentofw.dao.SimpleDaoHelperImpl |
|---|
select, update |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DaoHelperForJdbc()
throws NestedException,
SimpleException
NestedException
SimpleException| Method Detail |
|---|
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface SimpleDaoHelpergetConnection in class SimpleDaoHelperImpljava.sql.SQLException
public java.sql.PreparedStatement getPrepareStatement(java.sql.Connection con,
java.lang.String sql)
throws java.sql.SQLException
getPrepareStatement in interface SimpleDaoHelpergetPrepareStatement in class SimpleDaoHelperImplcon - JDBC Connectionsql - SQL statement
java.sql.SQLException
public void closeResource(java.sql.ResultSet res,
java.sql.PreparedStatement ps,
java.sql.Connection con,
boolean isOK)
closeResource in interface SimpleDaoHelpercloseResource in class SimpleDaoHelperImplres - ResultSetps - PreparedStatementcon - ConnectionisOK - This parameter will be always ignored in this
implementation.
This parameter will be used only by
DaoHelperForPooledStatement, because the
PreparedStatement should not be pushed back to the pool if
something is wrong.
But, to make your code portable between the implementations,
please specify the correct value.
If SQLException is thrown while playing with
PreparedStatement, please specify false.
Otherwise, true.
|
OOP SimpleDaoHelper Version 1.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ALL CONTENTS COPYRIGHT 2005, OOP-Research Corporation. All rights reserved.
Any questions and comments are welcome to OOP-Research Corporation.