Package com.jk.data.vendors.oracle
Class JKOracleDataAccess
java.lang.Object
com.jk.data.dataaccess.core.JKDataAccessImpl
com.jk.data.vendors.oracle.JKOracleDataAccess
- All Implemented Interfaces:
JKDataAccessService
This class provides data access functionality specific to Oracle databases.
It extends the JKDataAccessImpl
class.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Field Summary
Fields inherited from class com.jk.data.dataaccess.core.JKDataAccessImpl
acceptedTimeInMillis, bufferSize, logger, maxAcceptedTimeInMillis
-
Constructor Summary
ConstructorsConstructorDescriptionJKOracleDataAccess
(JKDataSource dataSource) This method constructs a newJKOracleDataAccess
with the provided data source. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
blobToByteArray
(Blob blob) This method converts aBlob
object to a byte array.describeTable
(String name) This method retrieves data about a database table and returns it as a map of column names to their corresponding data types.int
getNextSequence
(String squenceName) This method retrieves the next value from a specified sequence in the database.This method retrieves the current system date and time from the database.protected boolean
This method checks if the providedSQLException
indicates a duplicate key violation.protected boolean
isDuplicateKey
(SQLException e, boolean throwException) This method checks if the providedSQLException
indicates a duplicate key violation.boolean
isTableExists
(String tableName) This method checks whether the table with the provided name exists in the database or not.Methods inherited from class com.jk.data.dataaccess.core.JKDataAccessImpl
addQueryLog, beginTransaction, call, call, close, close, close, close, close, close, closeTransaction, dropTable, execute, executeQueryAsArray, executeQueryAsCachedRowSet, executeQueryAsIdValue, executeQueryAsList, executeQueryAsString, executeQueryAsString, executeSingleOutputQuery, executeUpdate, executeUpdate, executeUpdate, find, findAndCacheRecord, findRecord, findRecord, getCaller, getConnection, getConnection, getDataSource, getGeneratedKey, getList, getList, getList, getListAndCache, getNextId, getNextId, getNextId, getNextId, getRowsCount, isInTransaction, loadSql, prepareQueryStatement, prepareQueryStatement, prepareStatement, prepareStatement, prepareStatement, printRecordResultSet, printRecordResultSet, resetCache, runScript, setParams, setSession, writeLog
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jk.data.dataaccess.core.JKDataAccessService
callAsSingleOutput, executeQueryAsDouble, executeQueryAsInteger, executeQueryAsListOfObjects, executeQueryAsListOfObjects, executeQueryAsLong, executeQueryAsMap, executeQueryAsRow, getTenantId
-
Constructor Details
-
JKOracleDataAccess
This method constructs a newJKOracleDataAccess
with the provided data source.- Parameters:
dataSource
- Specifies the data source.
-
-
Method Details
-
blobToByteArray
This method converts aBlob
object to a byte array.- Parameters:
blob
- Specifies theBlob
object to convert.- Returns:
- the byte array representation of the `Blob` data.
- Throws:
IOException
- if an I/O exception has occurred.SQLException
- if a SQL error occurs while accessing theBlob
.
-
getNextSequence
This method retrieves the next value from a specified sequence in the database.- Parameters:
squenceName
- Specifies the name of the sequence from which to retrieve the next value.- Returns:
- the next value from the specified sequence as an integer.
-
getSystemDate
This method retrieves the current system date and time from the database.- Specified by:
getSystemDate
in interfaceJKDataAccessService
- Overrides:
getSystemDate
in classJKDataAccessImpl
- Returns:
- a
Date
object representing the current system date and time
-
isDuplicateKey
This method checks if the providedSQLException
indicates a duplicate key violation.- Parameters:
e
- Specifies the exception to check.- Returns:
- true, if the exception indicates a duplicate key violation, false otherwise.
- Throws:
SQLException
- if the exception is not a duplicate key violation.
-
isDuplicateKey
This method checks if the providedSQLException
indicates a duplicate key violation.- Parameters:
e
- Specifies the exception to check.throwException
- Indicates whether to throw the exception if it's not a duplicate key violation (true) or not (false).- Returns:
- true, if the exception indicates a duplicate key violation, false otherwise.
- Throws:
SQLException
- if the exception is not a duplicate key violation andthrowException
istrue
.
-
isTableExists
This method checks whether the table with the provided name exists in the database or not.- Specified by:
isTableExists
in interfaceJKDataAccessService
- Overrides:
isTableExists
in classJKDataAccessImpl
- Parameters:
tableName
- Specifies the table name in the database.- Returns:
- true, if the table exists, false otherwise.
-
describeTable
This method retrieves data about a database table and returns it as a map of column names to their corresponding data types.- Specified by:
describeTable
in interfaceJKDataAccessService
- Overrides:
describeTable
in classJKDataAccessImpl
- Parameters:
name
- Specifies the name of the table to describe.- Returns:
- the map containing column names as keys and their corresponding data types as values.
-