1 | /* |
2 | |
3 | Derby - Class org.apache.derby.jdbc.Driver169 |
4 | |
5 | Copyright 1997, 2005 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.jdbc; |
22 | |
23 | |
24 | import org.apache.derby.iapi.sql.ResultSet; |
25 | |
26 | import org.apache.derby.impl.jdbc.*; |
27 | |
28 | import java.sql.Connection; |
29 | import java.sql.SQLException; |
30 | |
31 | import java.util.Properties; |
32 | |
33 | |
34 | /** |
35 | Driver169 - JDBC "driver" for J2ME/CDC/Foundation/JSR169, really |
36 | the JDBC object factory for the JSR169 environment. |
37 | |
38 | WORK IN PROGRESS |
39 | |
40 | |
41 | @author djd |
42 | */ |
43 | |
44 | public class Driver169 extends InternalDriver { |
45 | |
46 | public Driver169() { |
47 | } |
48 | |
49 | /* |
50 | Methods to be overloaded in sub-implementations such as |
51 | a tracing driver. |
52 | */ |
53 | protected EmbedConnection getNewEmbedConnection(String url, Properties info) |
54 | throws SQLException |
55 | { |
56 | // make a new local connection with a new transaction resource |
57 | return new EmbedConnection30(this, url, info); |
58 | } |
59 | |
60 | |
61 | /** |
62 | * Get a new nested connection. |
63 | * |
64 | * @param conn The EmbedConnection. |
65 | * |
66 | * @return A nested connection object. |
67 | * |
68 | */ |
69 | public Connection getNewNestedConnection(EmbedConnection conn) |
70 | { |
71 | return new EmbedConnection30(conn); |
72 | } |
73 | |
74 | /* |
75 | ** methods to be overridden by subimplementations wishing to insert |
76 | ** their classes into the mix. |
77 | */ |
78 | |
79 | public java.sql.Statement newEmbedStatement( |
80 | EmbedConnection conn, |
81 | boolean forMetaData, |
82 | int resultSetType, |
83 | int resultSetConcurrency, |
84 | int resultSetHoldability) |
85 | { |
86 | return new EmbedStatement(conn, forMetaData, resultSetType, resultSetConcurrency, |
87 | resultSetHoldability); |
88 | } |
89 | /** |
90 | @exception SQLException if fails to create statement |
91 | */ |
92 | public java.sql.PreparedStatement newEmbedPreparedStatement( |
93 | EmbedConnection conn, |
94 | String stmt, |
95 | boolean forMetaData, |
96 | int resultSetType, |
97 | int resultSetConcurrency, |
98 | int resultSetHoldability, |
99 | int autoGeneratedKeys, |
100 | int[] columnIndexes, |
101 | String[] columnNames) |
102 | throws SQLException |
103 | |
104 | { |
105 | return new EmbedPreparedStatement169(conn, stmt, forMetaData, |
106 | resultSetType, resultSetConcurrency, resultSetHoldability, |
107 | autoGeneratedKeys, columnIndexes, columnNames); |
108 | } |
109 | /** |
110 | @exception SQLException if fails to create statement |
111 | */ |
112 | public java.sql.CallableStatement newEmbedCallableStatement( |
113 | EmbedConnection conn, |
114 | String stmt, |
115 | int resultSetType, |
116 | int resultSetConcurrency, |
117 | int resultSetHoldability) |
118 | throws SQLException |
119 | { |
120 | return new EmbedCallableStatement169(conn,stmt, resultSetType, |
121 | resultSetConcurrency, resultSetHoldability); |
122 | } |
123 | |
124 | |
125 | public EmbedResultSet |
126 | newEmbedResultSet(EmbedConnection conn, ResultSet results, boolean forMetaData, EmbedStatement statement, boolean isAtomic) |
127 | throws SQLException |
128 | { |
129 | return new EmbedResultSet169(conn, results, forMetaData, statement, isAtomic); |
130 | } |
131 | |
132 | |
133 | |
134 | } |
135 | |
136 | |
137 | |