/
ISqlTemplate.java
144 lines (89 loc) · 5.23 KB
/
ISqlTemplate.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jumpmind.db.sql;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* This interface insulates the application from the data connection technology.
*/
public interface ISqlTemplate {
@Deprecated
public byte[] queryForBlob(String sql, Object... args);
public byte[] queryForBlob(String sql, int jdbcTypeCode, String jdbcTypeName, Object... args);
@Deprecated
public String queryForClob(final String sql, final Object... args);
public String queryForClob(String sql, int jdbcTypeCode, String jdbcTypeName, Object... args);
public <T> T queryForObject(String sql, Class<T> clazz, Object... params);
public <T> T queryForObject(String sql, ISqlRowMapper<T> mapper, Object... params);
public int queryForInt(String sql, Map<String,Object> params);
public int queryForInt(String sql, Object... args);
public String queryForString(String sql, Object... args);
public long queryForLong(String sql, Object... args);
public Row queryForRow(String sql, Object... args);
public Map<String, Object> queryForMap(String sql, Object... params);
public <T> Map<String, T> queryForMap(String sql, ISqlRowMapper<T> mapper, String keyColumn,
Object... args);
public <T> Map<String, T> queryForMap(String sql, String keyColumn, String valueColumn,
Object... args);
public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper,
Object[] params, int[] types);
public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper,
IConnectionHandler connectionHandler, Object[] params, int[] types);
public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper);
public List<Row> query(String sql);
public List<Row> query(String sql, Object[] params, int[] types);
public List<Row> query(String sql, Object[] params);
public <T> List<T> query(String sql, ISqlRowMapper<T> mapper, Map<String,?> namedParams);
public <T> List<T> query(String sql, ISqlRowMapper<T> mapper, Object... params);
public <T> List<T> queryWithHandler(String sql, ISqlRowMapper<T> mapper, IConnectionHandler conHandler, Object... params);
public <T> List<T> query(String sql, ISqlRowMapper<T> mapper, Object[] params, int[] types);
public <T> List<T> query(String sql, int maxRowsToFetch, ISqlRowMapper<T> mapper, Object[] params, int[] types);
public <T> List<T> query(String sql, int maxRowsToFetch, ISqlRowMapper<T> mapper, Object... params);
public <T> List<T> query(String sql, int maxRowsToFetch, ISqlRowMapper<T> mapper, Map<String,Object> params);
public <T, W> Map<T, W> query(String sql, String keyCol, String valueCol, Object[] params,
int[] types);
public int update(boolean autoCommit, boolean failOnError, int commitRate, ISqlResultsListener listener, String... sql);
public int update(boolean autoCommit, boolean failOnError, boolean failOnDrops, boolean failOnSequenceCreate, int commitRate, ISqlResultsListener listener, ISqlStatementSource source);
public int update(boolean autoCommit, boolean failOnError, int commitRate, String... sql);
public int update(String sql, Object[] values, int[] types);
public int update(String sql, Object... values);
public void testConnection();
public SqlException translate(Throwable ex);
public boolean isUniqueKeyViolation(Throwable ex);
public boolean isDataTruncationViolation(Throwable ex);
public boolean isForeignKeyViolation(Throwable ex);
public ISqlTransaction startSqlTransaction();
public ISqlTransaction startSqlTransaction(boolean autoCommit);
public int getDatabaseMajorVersion();
public int getDatabaseMinorVersion();
public String getDatabaseProductName();
public String getDatabaseProductVersion();
public String getDriverName();
public String getDriverVersion();
public Set<String> getSqlKeywords();
public boolean supportsGetGeneratedKeys();
public boolean isStoresUpperCaseIdentifiers();
public boolean isStoresLowerCaseIdentifiers();
public boolean isStoresMixedCaseQuotedIdentifiers();
public long insertWithGeneratedKey(final String sql, String column, final String sequenceName,
final Object[] args, final int[] types);
}