01: /*
02:
03: Derby - Class org.apache.derby.vti.VTIEnvironment
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.vti;
23:
24: /**
25: *
26: * VTIEnvironment is an interface used in costing VTIs.
27: *
28: * The interface is
29: * passed as a parameter to various methods in the Virtual Table interface.
30: *
31: * @see org.apache.derby.vti.VTICosting
32: */
33: public interface VTIEnvironment {
34:
35: /**
36: Return true if this instance of the VTI has been created for compilation,
37: false if it is for runtime execution.
38: */
39: public boolean isCompileTime();
40:
41: /**
42: Return the SQL text of the original SQL statement.
43: */
44: public String getOriginalSQL();
45:
46: /**
47: Get the specific JDBC isolation of the statement. If it returns Connection.TRANSACTION_NONE
48: then no isolation was specified and the connection's isolation level is implied.
49: */
50: public int getStatementIsolationLevel();
51:
52: /**
53: Saves an object associated with a key that will be maintained
54: for the lifetime of the statement plan.
55: Any previous value associated with the key is discarded.
56: Any saved object can be seen by any JDBC Connection that has a Statement object
57: that references the same statement plan.
58: */
59: public void setSharedState(String key, java.io.Serializable value);
60:
61: /**
62: Get an an object associated with a key from set of objects maintained with the statement plan.
63: */
64: public Object getSharedState(String key);
65: }
|