Package com.spotfire.ws.im.ds.sql
Class BasicSQLRuntime
java.lang.Object
com.spotfire.ws.im.ds.sql.BasicSQLRuntime
- All Implemented Interfaces:
SQLRuntime
A basic implementation of the
SQLRuntime
interface.- Since:
- 3.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeStatement
(Statement stmt) Closes a JDBCStatement
object.protected Statement
Creates a new JDBCStatement
instance.executeQuery
(String sql) Executes a SQL query.void
executeUpdate
(String sql) Executes a SQL statement.prepareCall
(String sql) Creates aCallableStatement
object for calling database stored procedures.prepareQuery
(String sql) prepareUpdate
(String sql) void
setConnection
(Connection conn) Sets the JDBC database connection.void
Sets the JDBC context.
-
Constructor Details
-
BasicSQLRuntime
public BasicSQLRuntime()Creates a newBasicSQLRuntime
instance.- Since:
- 3.0
-
-
Method Details
-
setConnection
Description copied from interface:SQLRuntime
Sets the JDBC database connection.- Specified by:
setConnection
in interfaceSQLRuntime
- Parameters:
conn
- connection- Since:
- 3.0
-
getConnection
- Specified by:
getConnection
in interfaceSQLRuntime
- Returns:
- Returns the JDBC database connection.
- Since:
- 3.0
-
setContext
Description copied from interface:SQLRuntime
Sets the JDBC context.- Specified by:
setContext
in interfaceSQLRuntime
- Parameters:
s
- JDBCContext- Since:
- 3.0
-
getContext
- Specified by:
getContext
in interfaceSQLRuntime
- Returns:
- Returns the JDBC context.
- Since:
- 3.0
-
executeUpdate
Description copied from interface:SQLRuntime
Executes a SQL statement.- Specified by:
executeUpdate
in interfaceSQLRuntime
- Parameters:
sql
- SQL- Throws:
SQLException
- SQLException- Since:
- 3.0
-
prepareUpdate
- Specified by:
prepareUpdate
in interfaceSQLRuntime
- Parameters:
sql
- SQL- Returns:
- Creates a precompiled SQL statement.
- Throws:
SQLException
- SQLException- Since:
- 3.0
-
prepareQuery
- Specified by:
prepareQuery
in interfaceSQLRuntime
- Parameters:
sql
- SQL- Returns:
- Creates a precompiled SQL statement for a parameterized query.
- Throws:
SQLException
- SQLException- Since:
- 3.0
-
executeQuery
Description copied from interface:SQLRuntime
Executes a SQL query.- Specified by:
executeQuery
in interfaceSQLRuntime
- Parameters:
sql
- SQL- Returns:
- ResultSet
- Throws:
SQLException
- SQLException- Since:
- 3.0
-
prepareCall
Description copied from interface:SQLRuntime
Creates aCallableStatement
object for calling database stored procedures.- Specified by:
prepareCall
in interfaceSQLRuntime
- Parameters:
sql
- SQL- Returns:
- CallableStatement
- Throws:
SQLException
- SQLException- Since:
- 3.0
-
createStatement
Creates a new JDBCStatement
instance.- Returns:
- a new
Statement
object - Throws:
SQLException
- if database error occurs- Since:
- 3.0
-
closeStatement
Closes a JDBCStatement
object.- Parameters:
stmt
- aStatement
object- Since:
- 3.0
-