DataBridge Documentation 2.0.17
A Java library for managing database connections and transactions
Loading...
Searching...
No Matches
io.github.kdesp73.databridge.connections.OracleConnection Class Reference
Inheritance diagram for io.github.kdesp73.databridge.connections.OracleConnection:
io.github.kdesp73.databridge.connections.DatabaseConnection AutoCloseable

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

Detailed Description

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.

Member Function Documentation

◆ get()

Connection io.github.kdesp73.databridge.connections.OracleConnection.get ( )

Returns the underlying Connection object for the Oracle database.

Returns
the Connection instance for the database connection.

Implements io.github.kdesp73.databridge.connections.DatabaseConnection.

◆ connect()

void io.github.kdesp73.databridge.connections.OracleConnection.connect ( String url,
String username,
String password ) throws SQLException

Establishes a connection to the Oracle database.

Parameters
urlthe database URL in the format jdbc:oracle:thin:@host:port:service.
usernamethe username for database access.
passwordthe password for database access.
Exceptions
SQLExceptionif the connection to the database fails.

Implements io.github.kdesp73.databridge.connections.DatabaseConnection.

◆ executeUpdate()

int io.github.kdesp73.databridge.connections.OracleConnection.executeUpdate ( String query) throws SQLException

Executes an UPDATE SQL query (INSERT, UPDATE, DELETE) on the Oracle database.

Parameters
querythe SQL query string to execute.
Returns
the number of rows affected by the query.
Exceptions
SQLExceptionif a database access error occurs or if the query is invalid.

Implements io.github.kdesp73.databridge.connections.DatabaseConnection.

◆ executeQuery()

ResultSet io.github.kdesp73.databridge.connections.OracleConnection.executeQuery ( String query) throws SQLException

Executes a SELECT SQL query and returns the result as a ResultSet.

Parameters
querythe SQL SELECT query string to execute.
Returns
a ResultSet containing the result of the query.
Exceptions
SQLExceptionif a database access error occurs or if the query is invalid.

Implements io.github.kdesp73.databridge.connections.DatabaseConnection.

◆ execute()

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.

Parameters
querythe SQL DDL query string to execute.
Returns
true if the query executed successfully, false otherwise.
Exceptions
SQLExceptionif a database access error occurs or if the query is invalid.

Implements io.github.kdesp73.databridge.connections.DatabaseConnection.

◆ close()

void io.github.kdesp73.databridge.connections.OracleConnection.close ( ) throws SQLException

Closes the database connection, releasing any resources.

Exceptions
SQLExceptionif an error occurs while closing the connection.

Implements io.github.kdesp73.databridge.connections.DatabaseConnection.

◆ callFunction()

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.

Parameters
functionNamethe name of the Oracle function to call.
paramsthe parameters to pass to the function.
Returns
a ResultSet containing the results of the function call. The caller is responsible for closing the ResultSet.
Exceptions
SQLExceptionif an error occurs during the function call.

◆ callFunctionValue()

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.

Parameters
functionNamethe name of the Oracle function to call.
returnTypethe JDBC return type of the function result.
paramsthe parameters to pass to the function.
Returns
the result of the function call.
Exceptions
SQLExceptionif an error occurs during the function call.

◆ callProcedure()

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.

Parameters
procedureNamethe name of the Oracle procedure to call.
paramsthe parameters to pass to the procedure.
Exceptions
SQLExceptionif an error occurs during the procedure call.

The documentation for this class was generated from the following file: