DataBridge Documentation 2.0.17
A Java library for managing database connections and transactions
|
Public Member Functions | |
ResultSet | callFunction (String functionName, Object... params) throws SQLException |
Object | callFunctionValue (String functionName, int returnType, Object... params) throws SQLException |
void | callProcedure (String procedureName, Object... params) throws SQLException |
void | close () throws SQLException |
void | connect (String url, String username, String password) throws SQLException |
boolean | execute (String query) throws SQLException |
ResultSet | executeQuery (String query) throws SQLException |
int | executeUpdate (String query) throws SQLException |
Connection | get () |
Public Member Functions inherited from io.github.kdesp73.databridge.connections.DatabaseConnection |
The OracleConnection
class implements the DatabaseConnection
interface for connecting to and interacting with an Oracle database.
This class provides methods to establish a connection, execute SQL queries (SELECT, UPDATE), call Oracle functions and procedures, and close the connection. It also supports calling functions that return values or tables and handles retries for failed operations using the Again
helper.
This class also logs errors related to database operations using the SQLogger
.
Connection io.github.kdesp73.databridge.connections.OracleConnection.get | ( | ) |
Returns the underlying Connection
object for the Oracle database.
Connection
instance for the database connection. Implements io.github.kdesp73.databridge.connections.DatabaseConnection.
void io.github.kdesp73.databridge.connections.OracleConnection.connect | ( | String | url, |
String | username, | ||
String | password ) throws SQLException |
Establishes a connection to the Oracle database.
url | the database URL in the format jdbc:oracle:thin:@host:port:service . |
username | the username for database access. |
password | the password for database access. |
SQLException | if the connection to the database fails. |
Implements io.github.kdesp73.databridge.connections.DatabaseConnection.
int io.github.kdesp73.databridge.connections.OracleConnection.executeUpdate | ( | String | query | ) | throws SQLException |
Executes an UPDATE SQL query (INSERT, UPDATE, DELETE) on the Oracle database.
query | the SQL query string to execute. |
SQLException | if a database access error occurs or if the query is invalid. |
Implements io.github.kdesp73.databridge.connections.DatabaseConnection.
ResultSet io.github.kdesp73.databridge.connections.OracleConnection.executeQuery | ( | String | query | ) | throws SQLException |
Executes a SELECT SQL query and returns the result as a ResultSet
.
query | the SQL SELECT query string to execute. |
ResultSet
containing the result of the query. SQLException | if a database access error occurs or if the query is invalid. |
Implements io.github.kdesp73.databridge.connections.DatabaseConnection.
boolean io.github.kdesp73.databridge.connections.OracleConnection.execute | ( | String | query | ) | throws SQLException |
Executes a DDL SQL query (e.g., CREATE, ALTER, DROP) on the Oracle database.
query | the SQL DDL query string to execute. |
true
if the query executed successfully, false
otherwise. SQLException | if a database access error occurs or if the query is invalid. |
Implements io.github.kdesp73.databridge.connections.DatabaseConnection.
void io.github.kdesp73.databridge.connections.OracleConnection.close | ( | ) | throws SQLException |
Closes the database connection, releasing any resources.
SQLException | if an error occurs while closing the connection. |
Implements io.github.kdesp73.databridge.connections.DatabaseConnection.
ResultSet io.github.kdesp73.databridge.connections.OracleConnection.callFunction | ( | String | functionName, |
Object... | params ) throws SQLException |
Calls a Oracle function that returns a table of records.
This method prepares and executes a SQL query to call the specified Oracle function, returning the result as a ResultSet
.
functionName | the name of the Oracle function to call. |
params | the parameters to pass to the function. |
ResultSet
containing the results of the function call. The caller is responsible for closing the ResultSet
. SQLException | if an error occurs during the function call. |
Object io.github.kdesp73.databridge.connections.OracleConnection.callFunctionValue | ( | String | functionName, |
int | returnType, | ||
Object... | params ) throws SQLException |
Calls a Oracle function that returns a single value.
This method prepares and executes a SQL call to the specified Oracle function, returning the value of the result.
functionName | the name of the Oracle function to call. |
returnType | the JDBC return type of the function result. |
params | the parameters to pass to the function. |
SQLException | if an error occurs during the function call. |
void io.github.kdesp73.databridge.connections.OracleConnection.callProcedure | ( | String | procedureName, |
Object... | params ) throws SQLException |
Calls a Oracle stored procedure.
This method prepares and executes a SQL call to the specified stored procedure.
procedureName | the name of the Oracle procedure to call. |
params | the parameters to pass to the procedure. |
SQLException | if an error occurs during the procedure call. |