001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.openjpa.jdbc.schema;
020:
021: import java.util.List;
022: import java.util.Properties;
023: import javax.sql.DataSource;
024:
025: import org.apache.openjpa.jdbc.sql.DBDictionary;
026:
027: /**
028: * A DataSource that allows additional configuration options to be set
029: * into it, so that it can wrap a JDBC driver or other DataSource.
030: *
031: * @author Marc Prud'hommeaux
032: */
033: public interface DriverDataSource extends DataSource {
034:
035: /**
036: * JDBC URL.
037: */
038: public void setConnectionURL(String connectionURL);
039:
040: /**
041: * JDBC URL.
042: */
043: public String getConnectionURL();
044:
045: /**
046: * Driver class name.
047: */
048: public void setConnectionDriverName(String connectionDriverName);
049:
050: /**
051: * Driver class name.
052: */
053: public String getConnectionDriverName();
054:
055: /**
056: * JDBC user name.
057: */
058: public void setConnectionUserName(String connectionUserName);
059:
060: /**
061: * JDBC user name.
062: */
063: public String getConnectionUserName();
064:
065: /**
066: * JDBC password.
067: */
068: public void setConnectionPassword(String connectionPassword);
069:
070: /**
071: * JDBC password.
072: */
073: public void setClassLoader(ClassLoader classLoader);
074:
075: /**
076: * Classloader for loading driver class, etc.
077: */
078: public ClassLoader getClassLoader();
079:
080: /**
081: * Configuration of datasource properties.
082: */
083: public void setConnectionFactoryProperties(Properties props);
084:
085: /**
086: * Configuration of datasource properties.
087: */
088: public Properties getConnectionFactoryProperties();
089:
090: /**
091: * Configuration of connection.
092: */
093: public void setConnectionProperties(Properties props);
094:
095: /**
096: * Configuration of connection.
097: */
098: public Properties getConnectionProperties();
099:
100: /**
101: * Provide any built-in decorators; may be null.
102: */
103: public List createConnectionDecorators();
104:
105: /**
106: * Initialize self and dictionary once available.
107: */
108: public void initDBDictionary(DBDictionary dict);
109: }
|