KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > Connection


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/Connection.java#12 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2000-2002 Kana Software, Inc.
7 // Copyright (C) 2001-2007 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, 29 February, 2000
12 */

13
14 package mondrian.olap;
15
16 import java.util.Locale JavaDoc;
17 import java.io.PrintWriter JavaDoc;
18
19 /**
20  * Connection to a multi-dimensional database.
21  *
22  * @see DriverManager
23  *
24  * @version $Id: //open/mondrian/src/main/mondrian/olap/Connection.java#12 $
25  * @author jhyde
26  */

27 public interface Connection {
28
29     /**
30      * Get the Connect String associated with this Connection.
31      *
32      * @return the Connect String (never null).
33      */

34     String JavaDoc getConnectString();
35
36     /**
37      * Get the name of the Catalog associated with this Connection.
38      *
39      * @return the Catalog name (never null).
40      */

41     String JavaDoc getCatalogName();
42
43     /**
44      * Get the Schema associated with this Connection.
45      *
46      * @return the Schema (never null).
47      */

48     Schema getSchema();
49
50     /**
51      * Closes this <code>Connection</code>. You may not use this
52      * <code>Connection</code> after closing it.
53      */

54     void close();
55
56     /**
57      * Executes a query.
58      *
59      * @throws RuntimeException if another thread calls {@link Query#cancel()}.
60      */

61     Result execute(Query query);
62
63     /**
64      * Returns the locale this connection belongs to. Determines, for example,
65      * the currency string used in formatting cell values.
66      *
67      * @see mondrian.util.Format
68      */

69     Locale JavaDoc getLocale();
70
71     /**
72      * Parses an expresion.
73      */

74     Exp parseExpression(String JavaDoc s);
75
76     /**
77      * Parses a query.
78      */

79     Query parseQuery(String JavaDoc s);
80
81     /**
82      * Sets the privileges for the this connection.
83      *
84      * @pre role != null
85      * @pre role.isMutable()
86      */

87     void setRole(Role role);
88
89     /**
90      * Returns the access-control profile for this connection.
91      * @post role != null
92      * @post role.isMutable()
93      */

94     Role getRole();
95
96     /**
97      * Returns a schema reader with access control appropriate to the current
98      * role.
99      */

100     SchemaReader getSchemaReader();
101
102     /**
103      * Returns the value of a connection property.
104      *
105      * @param name Name of property, for example "JdbcUser".
106      * @return Value of property, or null if property is not defined.
107      */

108     Object JavaDoc getProperty(String JavaDoc name);
109
110     /**
111      * Returns an object with which to explicitly control the contents of the
112      * cache.
113      *
114      * @param pw Writer to which to write logging information; may be null
115      */

116     CacheControl getCacheControl(PrintWriter JavaDoc pw);
117 }
118
119 // End Connection.java
120
Popular Tags