|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcgl.narada.service.storage.db.DataAccessObject
public class DataAccessObject
Constructor Summary | |
---|---|
DataAccessObject()
default constructor to initilize a connection required methods should be called sequentially as follows 1-) setDriver(parameter) 2-) setConnnectionInfo(parameters) 3-) setUserParameters(parameters) optional 4-) initilizeConnection(); |
Method Summary | |
---|---|
ResultSet |
executePreparedQuery(String pSqlQuery)
|
int |
executeUpdate(String sqlQuery)
to insert, delete query to execute in DB |
Connection |
getConnection()
|
String |
getConnectionInfo()
|
PreparedStatement |
getPreparedStatement(String pSqlQuery)
|
void |
initilizeConnection()
initialize the database connection |
static void |
main(String[] args)
|
void |
setConnectionParameters(String provider,
String host,
String db)
sets connection parameters |
void |
setConnectionParameters(String provider,
String host,
String port,
String db)
sets connection parameters |
void |
setConnnectionInfo(String cinfo)
sets connection info without setting parameters |
void |
setConnnectionInfo(String provider,
String host,
String db)
compose connection information from provided parameters |
void |
setConnnectionInfo(String provider,
String host,
String port,
String db)
compose connection information from provided parameters |
void |
setDriver(String driver)
sets database driver |
void |
setUserParameters(String uname,
String password)
sets user name and passwords |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataAccessObject() throws ServiceException
ServiceException
Method Detail |
---|
public void setDriver(String driver)
driver
- public void setConnectionParameters(String provider, String host, String db)
provider
- host
- db
- public void setConnectionParameters(String provider, String host, String port, String db)
provider
- host
- port
- db
- public void setConnnectionInfo(String cinfo)
cinfo
- connection informationpublic void setConnnectionInfo(String provider, String host, String db)
provider
- host
- db
- public void setConnnectionInfo(String provider, String host, String port, String db)
provider
- host
- port
- db
- public String getConnectionInfo()
public void setUserParameters(String uname, String password)
uname
- database user namepassword
- database user passwordpublic Connection getConnection()
public void initilizeConnection() throws ServiceException
ServiceException
public ResultSet executePreparedQuery(String pSqlQuery) throws ServiceException
ServiceException
public PreparedStatement getPreparedStatement(String pSqlQuery) throws ServiceException
ServiceException
public int executeUpdate(String sqlQuery) throws ServiceException
sqlQuery
-
ServiceException
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |