001: /*
002:
003: Derby - Class org.apache.derby.jdbc.Driver169
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to You under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.jdbc;
023:
024: import org.apache.derby.iapi.sql.ResultSet;
025:
026: import org.apache.derby.impl.jdbc.*;
027:
028: import java.sql.Connection;
029: import java.sql.SQLException;
030:
031: import java.util.Properties;
032:
033: /**
034: Driver169 - JDBC "driver" for J2ME/CDC/Foundation/JSR169, really
035: the JDBC object factory for the JSR169 environment.
036:
037: WORK IN PROGRESS
038:
039:
040: @author djd
041: */
042:
043: public class Driver169 extends InternalDriver {
044:
045: public Driver169() {
046: }
047:
048: /*
049: Methods to be overloaded in sub-implementations such as
050: a tracing driver.
051: */
052: protected EmbedConnection getNewEmbedConnection(String url,
053: Properties info) throws SQLException {
054: // make a new local connection with a new transaction resource
055: return new EmbedConnection30(this , url, info);
056: }
057:
058: /**
059: * Get a new nested connection.
060: *
061: * @param conn The EmbedConnection.
062: *
063: * @return A nested connection object.
064: *
065: */
066: public Connection getNewNestedConnection(EmbedConnection conn) {
067: return new EmbedConnection30(conn);
068: }
069:
070: /*
071: ** methods to be overridden by subimplementations wishing to insert
072: ** their classes into the mix.
073: */
074:
075: public java.sql.Statement newEmbedStatement(EmbedConnection conn,
076: boolean forMetaData, int resultSetType,
077: int resultSetConcurrency, int resultSetHoldability) {
078: return new EmbedStatement(conn, forMetaData, resultSetType,
079: resultSetConcurrency, resultSetHoldability);
080: }
081:
082: /**
083: @exception SQLException if fails to create statement
084: */
085: public java.sql.PreparedStatement newEmbedPreparedStatement(
086: EmbedConnection conn, String stmt, boolean forMetaData,
087: int resultSetType, int resultSetConcurrency,
088: int resultSetHoldability, int autoGeneratedKeys,
089: int[] columnIndexes, String[] columnNames)
090: throws SQLException
091:
092: {
093: return new EmbedPreparedStatement169(conn, stmt, forMetaData,
094: resultSetType, resultSetConcurrency,
095: resultSetHoldability, autoGeneratedKeys, columnIndexes,
096: columnNames);
097: }
098:
099: /**
100: @exception SQLException if fails to create statement
101: */
102: public java.sql.CallableStatement newEmbedCallableStatement(
103: EmbedConnection conn, String stmt, int resultSetType,
104: int resultSetConcurrency, int resultSetHoldability)
105: throws SQLException {
106: return new EmbedCallableStatement169(conn, stmt, resultSetType,
107: resultSetConcurrency, resultSetHoldability);
108: }
109:
110: public EmbedResultSet newEmbedResultSet(EmbedConnection conn,
111: ResultSet results, boolean forMetaData,
112: EmbedStatement statement, boolean isAtomic)
113: throws SQLException {
114: return new EmbedResultSet169(conn, results, forMetaData,
115: statement, isAtomic);
116: }
117:
118: }
|