1 21 22 package org.apache.derby.iapi.sql.conn; 23 24 import org.apache.derby.iapi.services.context.Context; 25 import org.apache.derby.iapi.services.context.ContextManager; 26 import org.apache.derby.iapi.db.Database; 27 import org.apache.derby.iapi.error.StandardException; 28 import org.apache.derby.iapi.sql.compile.CompilerContext; 29 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 30 import org.apache.derby.iapi.sql.dictionary.TableDescriptor; 31 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor; 32 import org.apache.derby.iapi.sql.compile.OptimizerFactory; 33 import org.apache.derby.iapi.types.DataValueFactory; 34 35 import org.apache.derby.iapi.sql.depend.Provider; 36 import org.apache.derby.iapi.sql.execute.ConstantAction; 37 import org.apache.derby.iapi.sql.execute.CursorActivation; 38 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement; 39 import org.apache.derby.iapi.sql.execute.ExecutionContext; 40 import org.apache.derby.iapi.sql.execute.ExecutionStmtValidator; 41 import org.apache.derby.iapi.sql.Activation; 42 import org.apache.derby.iapi.sql.LanguageFactory; 43 import org.apache.derby.iapi.sql.PreparedStatement; 44 import org.apache.derby.iapi.sql.ResultSet; 45 import org.apache.derby.iapi.sql.ParameterValueSet; 46 47 import org.apache.derby.iapi.store.access.TransactionController; 48 import org.apache.derby.iapi.store.access.AccessFactory; 49 import org.apache.derby.iapi.db.TriggerExecutionContext; 50 import org.apache.derby.iapi.services.i18n.LocaleFinder; 51 import org.apache.derby.iapi.sql.execute.RunTimeStatistics; 52 import org.apache.derby.catalog.UUID; 53 54 import java.util.Locale ; 55 import java.util.Hashtable ; 56 import java.util.Vector ; 57 58 68 public interface LanguageConnectionContext extends Context { 69 70 74 public static final String CONTEXT_ID = org.apache.derby.iapi.reference.ContextId.LANG_CONNECTION; 75 76 public static final int OUTERMOST_STATEMENT = 1; 77 78 public static final int SQL92_SCHEMAS = 0; 80 public static final int USER_NAME_SCHEMA = 1; public static final int NO_SCHEMAS = 2; 83 84 public static final String xidStr = "(XID = "; 85 public static final String lccStr = "(SESSIONID = "; 86 public static final String dbnameStr = "(DATABASE = "; 87 public static final String drdaStr = "(DRDAID = "; 88 89 91 public static final int SINGLE_TRANSACTION_LOCK = 1; 92 public static final int MULTI_TRANSACTION_LOCK = 2; 93 94 97 public static final int UNKNOWN_CASING = -1; 98 public static final int ANSI_CASING = 0; 99 public static final int ANTI_ANSI_CASING = 1; 100 101 108 void initialize(boolean sqlConnection) throws StandardException; 109 110 117 public boolean getLogStatementText(); 118 119 126 public void setLogStatementText(boolean logStatementText); 127 128 135 public boolean getLogQueryPlan(); 136 137 140 int getLockEscalationThreshold(); 141 142 146 void addActivation(Activation a) 147 throws StandardException; 148 149 152 void notifyUnusedActivation(); 153 154 159 void removeActivation(Activation a) 160 throws StandardException; 161 162 166 int getActivationCount(); 167 168 174 CursorActivation lookupCursorActivation(String cursorName); 175 176 182 public Activation getLastActivation(); 183 184 187 public String getUniqueCursorName(); 188 189 192 public String getUniqueSavepointName(); 193 194 197 public int getUniqueSavepointID(); 198 199 204 public boolean checkIfAnyDeclaredGlobalTempTablesForThisConnection(); 205 206 212 public void markTempTableAsModifiedInUnitOfWork(String tableName); 213 214 219 public void addDeclaredGlobalTempTable(TableDescriptor td) throws StandardException; 220 221 228 public boolean dropDeclaredGlobalTempTable(String tableName); 229 230 237 public TableDescriptor getTableDescriptorForDeclaredGlobalTempTable(String tableName); 238 239 243 public void resetFromPool() 244 throws StandardException; 245 246 256 void internalCommit( boolean commitStore ) 257 throws StandardException; 258 259 267 void internalCommitNoSync(int commitflag) throws StandardException; 268 269 275 void userCommit() throws StandardException; 276 277 285 void xaCommit(boolean onePhase) throws StandardException; 286 287 288 296 void internalRollback() throws StandardException; 297 298 304 void userRollback() throws StandardException; 305 306 320 void internalRollbackToSavepoint 321 ( String savepointName, boolean refreshStyle, Object kindOfSavepoint ) throws StandardException; 322 323 334 void releaseSavePoint ( String savepointName, Object kindOfSavepoint ) throws StandardException; 335 336 337 342 void xaRollback() throws StandardException; 343 344 355 void languageSetSavePoint( String savepointName, Object kindOfSavepoint ) throws StandardException; 356 357 361 boolean anyoneBlocked(); 362 363 369 void setTransaction( TransactionController tran ); 370 371 379 380 void beginNestedTransaction(boolean readOnly) throws StandardException; 381 382 394 void commitNestedTransaction() throws StandardException; 395 396 400 TransactionController getTransactionCompile(); 401 402 406 407 TransactionController getTransactionExecute(); 408 409 414 public String getSystemSchemaName() throws StandardException; 415 416 421 public String getSysIBMSchemaName() throws StandardException; 422 423 428 public String getSystemDiagSchemaName() throws StandardException; 429 430 435 public String getSystemUtilSchemaName() throws StandardException; 436 437 443 public DataDictionary getDataDictionary(); 444 445 449 DataValueFactory getDataValueFactory(); 450 451 455 LanguageFactory getLanguageFactory(); 456 457 460 OptimizerFactory getOptimizerFactory(); 461 462 466 LanguageConnectionFactory getLanguageConnectionFactory(); 467 468 473 public String getAuthorizationId(); 474 475 480 public String getDeclaredGlobalTemporaryTablesSchemaName() throws StandardException; 481 482 487 public SchemaDescriptor getDefaultSchema(); 488 489 496 public void setDefaultSchema(SchemaDescriptor sd) 497 throws StandardException; 498 499 504 public String getCurrentSchemaName(); 505 506 511 public Long getIdentityValue(); 512 513 518 public void setIdentityValue(long val); 519 520 532 boolean verifyNoOpenResultSets(PreparedStatement pStmt, Provider provider, 533 int action) 534 throws StandardException; 535 536 543 public boolean verifyAllHeldResultSetsAreClosed() 544 throws StandardException; 545 546 555 public CompilerContext pushCompilerContext(); 556 557 568 public CompilerContext pushCompilerContext(SchemaDescriptor sd); 569 570 577 public void popCompilerContext(CompilerContext compilerContext); 578 579 602 StatementContext pushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText, 603 ParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis); 604 605 611 public void popStatementContext(StatementContext statementContext, 612 Throwable error); 613 614 629 public void pushExecutionStmtValidator(ExecutionStmtValidator validator); 630 631 639 public void popExecutionStmtValidator(ExecutionStmtValidator validator) 640 throws StandardException; 641 642 652 public void validateStmtExecution(ConstantAction constantAction) 653 throws StandardException; 654 655 664 public void pushTriggerExecutionContext(TriggerExecutionContext tec) 665 throws StandardException; 666 667 675 public void popTriggerExecutionContext(TriggerExecutionContext tec) 676 throws StandardException; 677 678 683 public TriggerExecutionContext getTriggerExecutionContext(); 684 685 693 public void pushTriggerTable(TableDescriptor td); 694 695 700 public void popTriggerTable(TableDescriptor td); 701 702 709 public TableDescriptor getTriggerTable(); 710 711 718 int incrementBindCount(); 719 720 725 int decrementBindCount(); 726 727 732 int getBindCount(); 733 734 738 void setDataDictionaryWriteMode(); 739 740 745 boolean dataDictionaryInWriteMode(); 746 747 750 public void setRunTimeStatisticsMode(boolean onOrOff); 751 752 755 public boolean getRunTimeStatisticsMode(); 756 757 760 public void setStatisticsTiming(boolean onOrOff); 761 762 765 public boolean getStatisticsTiming(); 766 767 770 public void setRunTimeStatisticsObject(RunTimeStatistics runTimeStatisticsObject); 771 772 775 public RunTimeStatistics getRunTimeStatisticsObject(); 776 777 778 783 public int getStatementDepth(); 784 785 788 public Database getDatabase(); 789 790 793 public boolean isIsolationLevelSetUsingSQLorJDBC(); 794 802 public void resetIsolationLevelFlagUsedForSQLandJDBC(); 803 804 809 public void setIsolationLevel(int isolationLevel) throws StandardException; 810 811 816 public int getCurrentIsolationLevel(); 817 818 823 public String getCurrentIsolationLevelStr(); 824 public void setPrepareIsolationLevel(int isolationLevel) ; 825 826 834 public int getPrepareIsolationLevel(); 835 836 847 public void setReadOnly(boolean onOrOff) throws StandardException; 848 849 852 public boolean isReadOnly(); 853 854 857 public Authorizer getAuthorizer(); 858 859 862 ExecutionContext getExecutionContext(); 863 864 867 StatementContext getStatementContext(); 868 869 870 AccessFactory getAccessFactory(); 871 872 885 public PreparedStatement prepareInternalStatement(SchemaDescriptor compilationSchema, 886 String sqlText, boolean isForReadOnly, boolean allowInternalSyntax) 887 throws StandardException; 888 889 902 public PreparedStatement prepareInternalStatement(String sqlText) 903 throws StandardException; 904 905 912 public boolean setOptimizerTrace(boolean onOrOff); 913 914 919 public boolean getOptimizerTrace(); 920 921 928 public boolean setOptimizerTraceHtml(boolean onOrOff); 929 930 935 public boolean getOptimizerTraceHtml(); 936 937 945 public String getOptimizerTraceOutput(); 946 947 951 public void setOptimizerTraceOutput(String startingText); 952 953 956 public void appendOptimizerTraceOutput(String output); 957 958 964 public boolean isTransactionPristine(); 965 966 975 public Object getLockObject( int lockScope ) throws StandardException; 976 977 985 public int getIdentifierCasing() throws StandardException; 986 987 996 public String convertIdentifierCase( String id) throws StandardException; 997 998 999 1008 public Long lastAutoincrementValue(String schemaName, 1009 String tableName, 1010 String columnName); 1011 1012 1023 public void setAutoincrementUpdate(boolean flag); 1024 1025 1030 public boolean getAutoincrementUpdate(); 1031 1032 1036 public void copyHashtableToAIHT(Hashtable from); 1037 1038 1051 public long nextAutoincrementValue(String schemaName, String tableName, 1052 String columnName) 1053 throws StandardException; 1054 1055 1070 public void autoincrementFlushCache(UUID tableUUID) 1071 throws StandardException; 1072 1073 1088 public void autoincrementCreateCounter(String s, String t, String c, 1089 Long initialValue, long increment, 1090 int position); 1091 1092 1097 public int getInstanceNumber(); 1098 1099 1104 public String getDrdaID(); 1105 1106 1111 public void setDrdaID(String drdaID); 1112 1113 1118 public String getDbname(); 1119 1120 1125 public boolean usesSqlAuthorization(); 1126} 1127 | Popular Tags |