|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IControlConnection
For each connected database, we keep a "control connection". This connection is used for all shared usage to that particular database. This control connection is a wrapper of the connection created by connectivity layer and relies on connectivity layer to do connection caching/pooling. Shared usage refers to the following ones:
As you can see, all the above mentioned functions can be accomplished by using SQL Model, Database Model and the API from Connectivity layer. This is because SQL Dev Tools evolves at the same time with DTP Model Base project and Connectivity project, so you can view this interface as the ��adapter�� between SQL Dev Tools and the other 2 projects of DTP. In fact, we��ll provide a default implementation of this interface which uses SQL Model, Database Model and the API from Connectivity layer.
Method Summary | |
---|---|
java.lang.String |
convertToInternalConnId(java.lang.String externalId,
java.lang.String exteranlName)
As the connection id used inside IControlConnection may be different from those external ids. |
java.sql.Connection |
createConnection(java.lang.String[] connId)
|
boolean |
disconnect()
same as disconnect(false) |
boolean |
disconnect(boolean force)
Disconnects this control connection. |
void |
executeDDL(java.lang.String[] sql)
Creates or drops a routine object in the database by executing the definition statement |
ProcIdentifier[] |
getAllProcs()
gets all routine object identifiers exist in the database. |
DatabaseIdentifier |
getDatabaseIdentifier()
Returns which databaseIdentifier is used for this control connection |
IDBItem |
getDBItem(ProcIdentifier identifier)
NOTE: caller should check whether the return value is null. |
java.lang.String |
getDbUsername()
As the profile login name could be different from the database user name. |
java.lang.String |
getProcSource(ProcIdentifier proc)
Gets the source code of the specified routine. |
java.sql.Connection |
getReusableConnection()
Returns the wrapped connection object. |
IDatatype |
getTypeByNameStr(java.lang.String nameStr)
Gets a IDatatype object by name. |
boolean |
isTextHidden(DatabaseIdentifier databaseIdentifier,
java.lang.String dbObjectName,
int dbObjectType)
Checks if the Text of the procedural object is hidden. |
boolean |
okToDisconnect()
Whether it's ok to disconnect this control connection. |
void |
profileRenamed(java.lang.String profileName)
Should be called to keep in sync when profile name is changed while other profile properties are left unchanged. |
void |
refresh()
Refreshs all the cached routine object definitions. |
void |
refresh(ProcIdentifier procIdentifier)
Refreshs the specified cached routine object definitions. |
void |
saveRoutine(ProcIdentifier proc,
java.lang.String string)
Saves the specified routine object into database. |
boolean |
supportsDebugging()
Whether this control connection supports debugging. |
Method Detail |
---|
DatabaseIdentifier getDatabaseIdentifier()
DatabaseIdentifier
object, key of this control connectionvoid profileRenamed(java.lang.String profileName)
profileName
- the connection profile namejava.lang.String getDbUsername() throws java.sql.SQLException
java.sql.SQLException
java.lang.String getProcSource(ProcIdentifier proc) throws java.sql.SQLException
proc
- the identifier of a routine object
java.sql.SQLException
ProcIdentifier[] getAllProcs() throws java.sql.SQLException
ProcIdentifier
java.sql.SQLException
boolean okToDisconnect()
boolean disconnect(boolean force)
force
- whether force to disconnect even if still in use (by debugger, etc)
boolean disconnect()
java.sql.Connection getReusableConnection()
void saveRoutine(ProcIdentifier proc, java.lang.String string) throws java.sql.SQLException
proc
- routine identifierstring
- source code of the routine object
java.sql.SQLException
IDBItem getDBItem(ProcIdentifier identifier)
identifier
- routine identifier
void executeDDL(java.lang.String[] sql) throws java.sql.SQLException
sql
- the ddl statements
java.sql.SQLException
void refresh()
void refresh(ProcIdentifier procIdentifier)
procIdentifier
- routine identifierIDatatype getTypeByNameStr(java.lang.String nameStr) throws java.lang.Exception
IDatatype
object by name. e.g., given char(10), return a IDatatype object which describe char(10)
IDatatype
represented by the given name.
java.sql.SQLException
java.lang.Exception
boolean isTextHidden(DatabaseIdentifier databaseIdentifier, java.lang.String dbObjectName, int dbObjectType)
java.lang.String convertToInternalConnId(java.lang.String externalId, java.lang.String exteranlName) throws ConnectionException
externalId
- external connection idexteranlName
- optional connection name
ConnectionException
boolean supportsDebugging()
IDebuggerControlConnection
.
IDebuggerControlConnection
java.sql.Connection createConnection(java.lang.String[] connId) throws java.sql.SQLException, CoreException, NoSuchProfileException
java.sql.SQLException
CoreException
NoSuchProfileException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |