KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > jdbc > Driver169


1 /*
2
3    Derby - Class org.apache.derby.jdbc.Driver169
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (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.jdbc;
23
24
25 import org.apache.derby.iapi.sql.ResultSet;
26
27 import org.apache.derby.impl.jdbc.*;
28
29 import java.sql.Connection JavaDoc;
30 import java.sql.SQLException JavaDoc;
31
32 import java.util.Properties JavaDoc;
33
34
35 /**
36     Driver169 - JDBC "driver" for J2ME/CDC/Foundation/JSR169, really
37     the JDBC object factory for the JSR169 environment.
38     
39     WORK IN PROGRESS
40
41
42     @author djd
43 */

44
45 public class Driver169 extends InternalDriver {
46
47     public Driver169() {
48     }
49
50     /*
51         Methods to be overloaded in sub-implementations such as
52         a tracing driver.
53      */

54     protected EmbedConnection getNewEmbedConnection(String JavaDoc url, Properties JavaDoc info)
55          throws SQLException JavaDoc
56     {
57         // make a new local connection with a new transaction resource
58
return new EmbedConnection30(this, url, info);
59     }
60
61
62     /**
63      * Get a new nested connection.
64      *
65      * @param conn The EmbedConnection.
66      *
67      * @return A nested connection object.
68      *
69      */

70     public Connection JavaDoc getNewNestedConnection(EmbedConnection conn)
71     {
72         return new EmbedConnection30(conn);
73     }
74
75     /*
76     ** methods to be overridden by subimplementations wishing to insert
77     ** their classes into the mix.
78     */

79
80     public java.sql.Statement JavaDoc newEmbedStatement(
81                 EmbedConnection conn,
82                 boolean forMetaData,
83                 int resultSetType,
84                 int resultSetConcurrency,
85                 int resultSetHoldability)
86     {
87         return new EmbedStatement(conn, forMetaData, resultSetType, resultSetConcurrency,
88         resultSetHoldability);
89     }
90     /**
91         @exception SQLException if fails to create statement
92      */

93     public java.sql.PreparedStatement JavaDoc newEmbedPreparedStatement(
94                 EmbedConnection conn,
95                 String JavaDoc stmt,
96                 boolean forMetaData,
97                 int resultSetType,
98                 int resultSetConcurrency,
99                 int resultSetHoldability,
100                 int autoGeneratedKeys,
101                 int[] columnIndexes,
102                 String JavaDoc[] columnNames)
103         throws SQLException JavaDoc
104
105         {
106             return new EmbedPreparedStatement169(conn, stmt, forMetaData,
107                 resultSetType, resultSetConcurrency, resultSetHoldability,
108                 autoGeneratedKeys, columnIndexes, columnNames);
109         }
110     /**
111         @exception SQLException if fails to create statement
112      */

113     public java.sql.CallableStatement JavaDoc newEmbedCallableStatement(
114                 EmbedConnection conn,
115                 String JavaDoc stmt,
116                 int resultSetType,
117                 int resultSetConcurrency,
118                 int resultSetHoldability)
119         throws SQLException JavaDoc
120     {
121        return new EmbedCallableStatement169(conn,stmt, resultSetType,
122             resultSetConcurrency, resultSetHoldability);
123     }
124
125
126     public EmbedResultSet
127         newEmbedResultSet(EmbedConnection conn, ResultSet results, boolean forMetaData, EmbedStatement statement, boolean isAtomic)
128     throws SQLException JavaDoc
129     {
130         return new EmbedResultSet169(conn, results, forMetaData, statement, isAtomic);
131     }
132
133
134
135 }
136
137
138
139
Popular Tags