01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.gps.device.jdbc.dialect;
18:
19: import java.sql.PreparedStatement;
20: import java.sql.ResultSet;
21: import java.sql.SQLException;
22: import org.compass.gps.device.jdbc.mapping.ColumnMapping;
23: import org.compass.gps.device.jdbc.mapping.VersionColumnMapping;
24:
25: /**
26: * A dialect specific operations that might be different accross different
27: * databases.
28: *
29: * @author kimchy
30: *
31: */
32: public interface JdbcDialect {
33:
34: /**
35: * Returns the String value for the given column index. Will return
36: * <code>null</code> if the column value is <code>null</code>.
37: */
38: String getStringValue(ResultSet rs, int columnIndex)
39: throws SQLException;
40:
41: /**
42: * Returns the String value for the given column mapping. Will return
43: * <code>null</code> if the column value is <code>null</code>.
44: */
45: String getStringValue(ResultSet rs, ColumnMapping mapping)
46: throws SQLException;
47:
48: /**
49: * Returns the version value of the given version mapping. It is always a
50: * long value.
51: */
52: Long getVersion(ResultSet rs, VersionColumnMapping versionMapping)
53: throws SQLException;
54:
55: /**
56: * Sets the paremeter value for the given parameter index and the
57: * <code>PreparedStatement</code>.
58: */
59: void setParameter(PreparedStatement ps, int paramIndex, String value)
60: throws SQLException;
61: }
|