com.adventnet.snmp.snmp2
Class DatabaseOperationsImpl
java.lang.Object
|
+--com.adventnet.snmp.snmp2.DatabaseOperationsImpl
- class DatabaseOperationsImpl
- extends java.lang.Object
- implements com.adventnet.utils.DatabaseOperations
|
Field Summary |
(package private) com.adventnet.utils.DatabaseTableParams[] |
svd
|
|
Method Summary |
void |
closeDB()
This method should be invoked in case of closing the database connection. |
void |
connectDB(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String pass)
This method should be involked to initialize the Jdbc parameters in case
of database support. |
com.adventnet.utils.DatabaseTableParams |
getTableParams(int i)
|
boolean |
isPasswordEncryptionNeeded()
|
java.sql.ResultSet |
queryDB(java.lang.String s)
This method is used for making any database queries. |
int |
updateDB(java.lang.String s)
The method is used for making an update to the database. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
svd
com.adventnet.utils.DatabaseTableParams[] svd
DatabaseOperationsImpl
DatabaseOperationsImpl(SASClient sas)
throws java.sql.SQLException
connectDB
public void connectDB(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String pass)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
- This method should be involked to initialize the Jdbc parameters in case
of database support. Either initJdbcParams method or this one can be
called to make the database connection.
- Specified by:
- connectDB in interface com.adventnet.utils.DatabaseOperations
- Parameters:
driver - Name of the DataBase driver.url - URL pointing to the DataBase file nameuser - userNamepass - password
closeDB
public void closeDB()
throws java.sql.SQLException
- This method should be invoked in case of closing the database connection.
- Specified by:
- closeDB in interface com.adventnet.utils.DatabaseOperations
queryDB
public java.sql.ResultSet queryDB(java.lang.String s)
throws java.sql.SQLException
- This method is used for making any database queries. The queryString should
be passed as argument to the method. The returned ResultSet is the implementation
of AdvetnNet and not that of the concerned database driver. So only
the methods most needed are implemented. The methods implemeted are: next(),
previous(), first(), last(), afterLast(), beforeFirst(), isLast(), isFirst(),
isBeforeFirst(), isAfterLast(), getRow(), getString(int) and getString(String).
Rest of the methods will either return "null" or "-1" or "false".
- Specified by:
- queryDB in interface com.adventnet.utils.DatabaseOperations
- Parameters:
s - the SQL query string.
updateDB
public int updateDB(java.lang.String s)
throws java.sql.SQLException
- The method is used for making an update to the database.
- Specified by:
- updateDB in interface com.adventnet.utils.DatabaseOperations
- Parameters:
s - the SQL update string.
getTableParams
public com.adventnet.utils.DatabaseTableParams getTableParams(int i)
- Specified by:
- getTableParams in interface com.adventnet.utils.DatabaseOperations
isPasswordEncryptionNeeded
public boolean isPasswordEncryptionNeeded()
- Specified by:
- isPasswordEncryptionNeeded in interface com.adventnet.utils.DatabaseOperations