public class OracleDB extends BaseDB
| Modifier and Type | Class and Description |
|---|---|
static interface |
OracleDB.IPrivilegedAction
Action to execute as the privileged oracle user.
|
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
OracleDB() |
| Modifier and Type | Method and Description |
|---|---|
static Connection |
allocateConnectionAs(DataSource otherSchemaDs,
String otherUserName,
Connection sourceConn)
This allocates a connection to another user without that other-user's password, using an initial connection with DBA privileges.
|
protected String |
getCheckString()
Returns a SQL statement that is the cheapest way to check the validity of a connection.
|
protected int |
getFullSequenceID(Connection dbc,
String seqname)
Uses a table sequence to generate a value.
|
protected Reader |
getLobReader(Connection dbc,
ResultSet rs,
int col)
Returns a Reader from the blob (clob) column specified.
|
protected Reader |
getLobReader(Connection dbc,
ResultSet rs,
String col)
Returns a Reader from the blob (clob) column specified.
|
protected InputStream |
getLobStream(Connection dbc,
ResultSet rs,
int col)
Returns an InputStream from the blob (clob) column specified.
|
protected InputStream |
getLobStream(Connection dbc,
ResultSet rs,
String col)
Returns an InputStream from the blob (clob) column specified.
|
protected int |
getSequenceID(Connection dbc,
String tablename)
Uses a table sequence to generate a value.
|
boolean |
oracleOuterJoin() |
static void |
recompileAll(Connection dbc,
String schema,
boolean invalidsonly,
boolean charsemantics)
Recompile all packages or only invalid packages for the specified schema.
|
static Object |
runAsOtherSchemaUser(DataSource otherSchemaDs,
String otherUserName,
DataSource defaultDs,
OracleDB.IPrivilegedAction paction)
Execute the action passed using a connection that is logged in as the privileged user of other specified schema.
|
protected void |
setBlob_old(Connection dbc,
String table,
String column,
String where,
InputStream is,
int len)
Writes a blob to the requested record.
|
protected void |
setBlob(Connection dbc,
String table,
String column,
String[] pkfields,
Object[] key,
InputStream is,
int len)
Writes a blob to the requested record.
|
protected void |
setBlob(Connection dbc,
String table,
String column,
String where,
byte[][] data) |
protected void |
setBlob(Connection dbc,
String table,
String column,
String where,
InputStream is,
int len)
Writes a blob to the requested record.
|
static void |
setCharSemantics(Connection dbc,
boolean ischar)
Set the database session to CHAR or BYTE semantics.
|
protected void |
setClob(Connection dbc,
String table,
String column,
String where,
Reader r) |
static void |
updateSynonyms(DataSource ds,
String owner,
String... objectNames)
This method creates public synonyms for all objects in a schema (except TYPE objects).
|
getName, streamCopyprotected String getCheckString()
getCheckString in class BaseDBprotected int getSequenceID(Connection dbc, String tablename) throws SQLException
getSequenceID in class BaseDBdbc - the connectionSQLException - if the sequence could not be obtainedprotected int getFullSequenceID(Connection dbc, String seqname) throws SQLException
getFullSequenceID in class BaseDBdbc - the connectionSQLException - if the sequence could not be obtainedprotected void setBlob(Connection dbc, String table, String column, String where, InputStream is, int len) throws SQLException
BaseDBsetBlob in class BaseDBSQLExceptionprotected void setBlob(Connection dbc, String table, String column, String where, byte[][] data) throws SQLException
setBlob in class BaseDBSQLExceptionprotected void setBlob(Connection dbc, String table, String column, String[] pkfields, Object[] key, InputStream is, int len) throws SQLException
setBlob in class BaseDBSQLExceptionprotected void setBlob_old(Connection dbc, String table, String column, String where, InputStream is, int len) throws Exception
Exceptionprotected Reader getLobReader(Connection dbc, ResultSet rs, int col) throws Exception
getLobReader in class BaseDBrs - col - Exceptionprotected Reader getLobReader(Connection dbc, ResultSet rs, String col) throws Exception
getLobReader in class BaseDBrs - col - Exceptionprotected InputStream getLobStream(Connection dbc, ResultSet rs, int col) throws Exception
getLobStream in class BaseDBrs - col - Exceptionprotected InputStream getLobStream(Connection dbc, ResultSet rs, String col) throws Exception
getLobStream in class BaseDBrs - col - Exceptionpublic boolean oracleOuterJoin()
oracleOuterJoin in class BaseDBprotected void setClob(Connection dbc, String table, String column, String where, Reader r) throws Exception
public static void updateSynonyms(@Nonnull DataSource ds, @Nonnull String owner, String... objectNames)
ds - owner - objectNames - public static Object runAsOtherSchemaUser(@Nonnull DataSource otherSchemaDs, @Nonnull String otherUserName, @Nonnull DataSource defaultDs, @Nonnull OracleDB.IPrivilegedAction paction) throws Exception
otherSchemaDs - DataSource for other schema.otherUserName - Username - account that we use to run privileged action - we change its password temporary.defaultDs - DataSource that we use for password manipulations.paction - Privileged action that is executed under otherUserName account directly in otherSchemaDs.Exception@Nonnull public static Connection allocateConnectionAs(@Nonnull DataSource otherSchemaDs, @Nonnull String otherUserName, @Nonnull Connection sourceConn) throws Exception
otherSchemaDs - otherUserName - sourceConn - Exceptionpublic static void setCharSemantics(@Nonnull Connection dbc, boolean ischar) throws Exception
ischar - Exceptionpublic static void recompileAll(@Nonnull Connection dbc, @Nonnull String schema, boolean invalidsonly, boolean charsemantics) throws Exception
dbc - schema - invalidsonly - charsemantics - ExceptionCopyright © 2017 etc.to. All rights reserved.