|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SQLGateway
Interface used by OpenSMUS for communication with the default SQL database.
This object is optimized to work with lists of LValues as parameters and return values
to SQL queries. Scripting users will probably prefer to work with JDBC objects directly
if data manipulation is required.
SQLGateway is only present if the EnableSQLDatabase is used in the OpenSMUS.cfg file.
Use the getSQLGateway() method of the ServerObject interface to acquire this object.
Method Summary | |
---|---|
boolean |
connect(java.lang.String sqldriver,
java.lang.String sqlurl,
java.lang.String sqluser,
java.lang.String sqlpassword)
Connects to the default SQL database. |
void |
disconnect()
Disconnects from the SQL database Usually the connection is kept open for the entire duration of the OpenSMUS session |
LValue |
executeQuery(java.lang.String sqlquery,
LList params)
Executes an SQL query call Use question marks in the query as placeholders for values contained in the params list. |
boolean |
executeUpdate(java.lang.String sqlquery,
LList params)
Executes an SQL update call Use question marks in the query as placeholders for values contained in the params list. |
java.sql.Connection |
getConnection()
Returns the default SQL database connection as a java.sql.Connection object. |
boolean |
isConnected()
Checks if the SQL database connection is alive |
Method Detail |
---|
boolean isConnected()
java.sql.Connection getConnection()
boolean connect(java.lang.String sqldriver, java.lang.String sqlurl, java.lang.String sqluser, java.lang.String sqlpassword)
sqldriver
- JDBC database driversqlurl
- JDBC database URLsqluser
- Username for connectionsqlpassword
- Password for connectionvoid disconnect()
boolean executeUpdate(java.lang.String sqlquery, LList params)
sqlquery
- Prepared SQL query string.params
- LList of parameters to the prepared statement.
LValue executeQuery(java.lang.String sqlquery, LList params)
sqlquery
- Prepared SQL query string.params
- LList of parameters to the prepared statement.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |