embulk-output-oracle 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +155 -110
- data/build.gradle +6 -6
- data/classpath/embulk-output-jdbc-0.3.0.jar +0 -0
- data/classpath/embulk-output-oracle-0.3.0.jar +0 -0
- data/lib/embulk/output/oracle.rb +3 -3
- data/src/main/cpp/common/dir-path-load.cpp +424 -424
- data/src/main/cpp/common/dir-path-load.h +36 -36
- data/src/main/cpp/common/embulk-output-oracle.cpp +196 -196
- data/src/main/cpp/common/org_embulk_output_oracle_oci_OCI.h +77 -77
- data/src/main/cpp/linux/build.sh +21 -21
- data/src/main/cpp/win/build.bat +31 -31
- data/src/main/cpp/win/dllmain.cpp +25 -25
- data/src/main/cpp/win/embulk-output-oracle.sln +39 -39
- data/src/main/cpp/win/embulk-output-oracle.vcxproj +175 -175
- data/src/main/java/org/embulk/output/OracleOutputPlugin.java +22 -66
- data/src/main/java/org/embulk/output/oracle/DirectBatchInsert.java +289 -289
- data/src/main/java/org/embulk/output/oracle/InsertMethod.java +8 -8
- data/src/main/java/org/embulk/output/oracle/OracleCharset.java +32 -19
- data/src/main/java/org/embulk/output/oracle/OracleOutputConnection.java +165 -134
- data/src/main/java/org/embulk/output/oracle/OracleOutputConnector.java +49 -49
- data/src/main/java/org/embulk/output/oracle/TimestampFormat.java +37 -37
- data/src/main/java/org/embulk/output/oracle/oci/ColumnDefinition.java +26 -26
- data/src/main/java/org/embulk/output/oracle/oci/OCI.java +139 -139
- data/src/main/java/org/embulk/output/oracle/oci/OCIManager.java +64 -64
- data/src/main/java/org/embulk/output/oracle/oci/OCIWrapper.java +96 -96
- data/src/main/java/org/embulk/output/oracle/oci/RowBuffer.java +99 -99
- data/src/main/java/org/embulk/output/oracle/oci/TableDefinition.java +24 -24
- data/src/test/cpp/common/embulk-output-oracle-test.cpp +69 -69
- data/src/test/cpp/linux/build.sh +19 -19
- data/src/test/cpp/win/build.bat +28 -28
- data/src/test/cpp/win/embulk-output-oracle-test.vcxproj +154 -154
- data/src/test/java/org/embulk/input/filesplit/LocalFileSplitInputPlugin.java +187 -187
- data/src/test/java/org/embulk/input/filesplit/PartialFile.java +49 -49
- data/src/test/java/org/embulk/input/filesplit/PartialFileInputStream.java +154 -154
- data/src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java +42 -42
- data/src/test/java/org/embulk/output/oracle/EmbulkPluginTester.java +120 -120
- data/src/test/java/org/embulk/output/oracle/EmptyConfigSource.java +100 -100
- data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTest.java +172 -161
- data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTestImpl.java +445 -413
- data/src/test/java/org/embulk/output/oracle/TimestampFormatTest.java +57 -57
- data/src/test/resources/data/test1/test1.csv +3 -3
- data/src/test/resources/yml/test-insert-direct.yml +26 -26
- data/src/test/resources/yml/test-insert-oci-split.yml +26 -26
- data/src/test/resources/yml/test-insert-oci.yml +26 -26
- data/src/test/resources/yml/test-insert.yml +25 -25
- data/src/test/resources/yml/test-replace-long-name-multibyte.yml +25 -0
- data/src/test/resources/yml/test-replace-long-name.yml +25 -25
- data/src/test/resources/yml/test-replace.yml +25 -25
- data/src/test/resources/yml/test-string-timestamp.yml +25 -0
- data/src/test/resources/yml/test-url.yml +24 -24
- metadata +6 -5
- data/classpath/embulk-output-jdbc-0.2.4.jar +0 -0
- data/classpath/embulk-output-oracle-0.2.4.jar +0 -0
- data/src/main/java/org/embulk/output/oracle/setter/OracleColumnSetterFactory.java +0 -31
@@ -1,134 +1,165 @@
|
|
1
|
-
package org.embulk.output.oracle;
|
2
|
-
|
3
|
-
|
4
|
-
import java.
|
5
|
-
import java.sql.
|
6
|
-
import java.sql.
|
7
|
-
import java.sql.
|
8
|
-
import java.sql.
|
9
|
-
import java.
|
10
|
-
import java.util.
|
11
|
-
|
12
|
-
|
13
|
-
import org.embulk.output.jdbc.
|
14
|
-
import org.embulk.output.jdbc.JdbcSchema;
|
15
|
-
|
16
|
-
public class OracleOutputConnection
|
17
|
-
extends JdbcOutputConnection
|
18
|
-
{
|
19
|
-
private static final Map<String, String> CHARSET_NAMES = new HashMap<String, String>();
|
20
|
-
static {
|
21
|
-
CHARSET_NAMES.put("JA16SJIS", "Shift_JIS");
|
22
|
-
CHARSET_NAMES.put("JA16SJISTILDE", "Shift_JIS");
|
23
|
-
CHARSET_NAMES.put("JA16EUC", "EUC-JP");
|
24
|
-
CHARSET_NAMES.put("JA16EUCTILDE", "EUC-JP");
|
25
|
-
CHARSET_NAMES.put("AL32UTF8", "UTF-8");
|
26
|
-
CHARSET_NAMES.put("UTF8", "UTF-8");
|
27
|
-
CHARSET_NAMES.put("AL16UTF16", "UTF-16");
|
28
|
-
}
|
29
|
-
|
30
|
-
private final boolean direct;
|
31
|
-
|
32
|
-
|
33
|
-
public OracleOutputConnection(Connection connection, boolean autoCommit, boolean direct)
|
34
|
-
throws SQLException
|
35
|
-
{
|
36
|
-
super(connection, getSchema(connection));
|
37
|
-
connection.setAutoCommit(autoCommit);
|
38
|
-
|
39
|
-
this.direct = direct;
|
40
|
-
}
|
41
|
-
|
42
|
-
@Override
|
43
|
-
protected String
|
44
|
-
{
|
45
|
-
switch(
|
46
|
-
case "BIGINT":
|
47
|
-
return "NUMBER(19,0)";
|
48
|
-
default:
|
49
|
-
return
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
@Override
|
54
|
-
protected void setSearchPath(String schema) throws SQLException {
|
55
|
-
// NOP
|
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
|
-
String
|
109
|
-
try (Statement statement = connection.createStatement()) {
|
110
|
-
try (ResultSet resultSet = statement.executeQuery(
|
111
|
-
if (resultSet.next()) {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
1
|
+
package org.embulk.output.oracle;
|
2
|
+
|
3
|
+
import java.nio.charset.Charset;
|
4
|
+
import java.sql.Connection;
|
5
|
+
import java.sql.PreparedStatement;
|
6
|
+
import java.sql.ResultSet;
|
7
|
+
import java.sql.SQLException;
|
8
|
+
import java.sql.Statement;
|
9
|
+
import java.util.HashMap;
|
10
|
+
import java.util.Map;
|
11
|
+
|
12
|
+
import org.embulk.output.jdbc.JdbcOutputConnection;
|
13
|
+
import org.embulk.output.jdbc.JdbcColumn;
|
14
|
+
import org.embulk.output.jdbc.JdbcSchema;
|
15
|
+
|
16
|
+
public class OracleOutputConnection
|
17
|
+
extends JdbcOutputConnection
|
18
|
+
{
|
19
|
+
private static final Map<String, String> CHARSET_NAMES = new HashMap<String, String>();
|
20
|
+
static {
|
21
|
+
CHARSET_NAMES.put("JA16SJIS", "Shift_JIS");
|
22
|
+
CHARSET_NAMES.put("JA16SJISTILDE", "Shift_JIS");
|
23
|
+
CHARSET_NAMES.put("JA16EUC", "EUC-JP");
|
24
|
+
CHARSET_NAMES.put("JA16EUCTILDE", "EUC-JP");
|
25
|
+
CHARSET_NAMES.put("AL32UTF8", "UTF-8");
|
26
|
+
CHARSET_NAMES.put("UTF8", "UTF-8");
|
27
|
+
CHARSET_NAMES.put("AL16UTF16", "UTF-16");
|
28
|
+
}
|
29
|
+
|
30
|
+
private final boolean direct;
|
31
|
+
private OracleCharset charset;
|
32
|
+
|
33
|
+
public OracleOutputConnection(Connection connection, boolean autoCommit, boolean direct)
|
34
|
+
throws SQLException
|
35
|
+
{
|
36
|
+
super(connection, getSchema(connection));
|
37
|
+
connection.setAutoCommit(autoCommit);
|
38
|
+
|
39
|
+
this.direct = direct;
|
40
|
+
}
|
41
|
+
|
42
|
+
@Override
|
43
|
+
protected String buildColumnTypeName(JdbcColumn c)
|
44
|
+
{
|
45
|
+
switch(c.getSimpleTypeName()) {
|
46
|
+
case "BIGINT":
|
47
|
+
return "NUMBER(19,0)";
|
48
|
+
default:
|
49
|
+
return super.buildColumnTypeName(c);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
@Override
|
54
|
+
protected void setSearchPath(String schema) throws SQLException {
|
55
|
+
// NOP
|
56
|
+
}
|
57
|
+
|
58
|
+
@Override
|
59
|
+
public void dropTableIfExists(String tableName) throws SQLException
|
60
|
+
{
|
61
|
+
if (tableExists(tableName)) {
|
62
|
+
dropTable(tableName);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
@Override
|
67
|
+
protected void dropTableIfExists(Statement stmt, String tableName) throws SQLException {
|
68
|
+
if (tableExists(tableName)) {
|
69
|
+
dropTable(stmt, tableName);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
@Override
|
74
|
+
public void createTableIfNotExists(String tableName, JdbcSchema schema) throws SQLException
|
75
|
+
{
|
76
|
+
if (!tableExists(tableName)) {
|
77
|
+
createTable(tableName, schema);
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
public void createTable(String tableName, JdbcSchema schema) throws SQLException
|
82
|
+
{
|
83
|
+
Statement stmt = connection.createStatement();
|
84
|
+
try {
|
85
|
+
String sql = buildCreateTableSql(tableName, schema);
|
86
|
+
executeUpdate(stmt, sql);
|
87
|
+
commitIfNecessary(connection);
|
88
|
+
} catch (SQLException ex) {
|
89
|
+
throw safeRollback(connection, ex);
|
90
|
+
} finally {
|
91
|
+
stmt.close();
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
protected String buildCreateTableSql(String name, JdbcSchema schema)
|
96
|
+
{
|
97
|
+
StringBuilder sb = new StringBuilder();
|
98
|
+
|
99
|
+
sb.append("CREATE TABLE ");
|
100
|
+
quoteIdentifierString(sb, name);
|
101
|
+
sb.append(buildCreateTableSchemaSql(schema));
|
102
|
+
return sb.toString();
|
103
|
+
}
|
104
|
+
|
105
|
+
private static String getSchema(Connection connection) throws SQLException
|
106
|
+
{
|
107
|
+
// Because old Oracle JDBC drivers don't support Connection#getSchema method.
|
108
|
+
String sql = "SELECT SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') FROM DUAL";
|
109
|
+
try (Statement statement = connection.createStatement()) {
|
110
|
+
try (ResultSet resultSet = statement.executeQuery(sql)) {
|
111
|
+
if (resultSet.next()) {
|
112
|
+
return resultSet.getString(1);
|
113
|
+
}
|
114
|
+
throw new SQLException(String.format("Cannot get schema becase \"%s\" didn't return any value.", sql));
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
@Override
|
120
|
+
protected String buildPreparedInsertSql(String toTable, JdbcSchema toTableSchema) throws SQLException
|
121
|
+
{
|
122
|
+
String sql = super.buildPreparedInsertSql(toTable, toTableSchema);
|
123
|
+
if (direct) {
|
124
|
+
sql = sql.replaceAll("^INSERT ", "INSERT /*+ APPEND_VALUES */ ");
|
125
|
+
}
|
126
|
+
return sql;
|
127
|
+
}
|
128
|
+
|
129
|
+
@Override
|
130
|
+
public Charset getTableNameCharset() throws SQLException
|
131
|
+
{
|
132
|
+
return getOracleCharset().getJavaCharset();
|
133
|
+
}
|
134
|
+
|
135
|
+
public synchronized OracleCharset getOracleCharset() throws SQLException
|
136
|
+
{
|
137
|
+
if (charset == null) {
|
138
|
+
String charsetName = "UTF8";
|
139
|
+
try (Statement statement = connection.createStatement()) {
|
140
|
+
try (ResultSet resultSet = statement.executeQuery("SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER='NLS_CHARACTERSET'")) {
|
141
|
+
if (resultSet.next()) {
|
142
|
+
String nlsCharacterSet = resultSet.getString(1);
|
143
|
+
if (CHARSET_NAMES.containsKey(nlsCharacterSet)) {
|
144
|
+
charsetName = nlsCharacterSet;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
try (PreparedStatement statement = connection.prepareStatement("SELECT NLS_CHARSET_ID(?) FROM DUAL")) {
|
151
|
+
statement.setString(1, charsetName);
|
152
|
+
try (ResultSet resultSet = statement.executeQuery()) {
|
153
|
+
if (!resultSet.next()) {
|
154
|
+
throw new SQLException("Unknown NLS_CHARACTERSET : " + charsetName);
|
155
|
+
}
|
156
|
+
|
157
|
+
charset = new OracleCharset(charsetName,
|
158
|
+
resultSet.getShort(1),
|
159
|
+
Charset.forName(CHARSET_NAMES.get(charsetName)));
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
return charset;
|
164
|
+
}
|
165
|
+
}
|
@@ -1,49 +1,49 @@
|
|
1
|
-
package org.embulk.output.oracle;
|
2
|
-
|
3
|
-
import java.sql.Connection;
|
4
|
-
import java.sql.DriverManager;
|
5
|
-
import java.sql.SQLException;
|
6
|
-
import java.util.Properties;
|
7
|
-
|
8
|
-
import org.embulk.output.jdbc.JdbcOutputConnector;
|
9
|
-
|
10
|
-
public class OracleOutputConnector
|
11
|
-
implements JdbcOutputConnector
|
12
|
-
{
|
13
|
-
private final String url;
|
14
|
-
private final Properties properties;
|
15
|
-
private final boolean direct;
|
16
|
-
|
17
|
-
public OracleOutputConnector(String url, Properties properties, boolean direct)
|
18
|
-
{
|
19
|
-
try {
|
20
|
-
Class.forName("oracle.jdbc.OracleDriver");
|
21
|
-
} catch (Exception ex) {
|
22
|
-
throw new RuntimeException(ex);
|
23
|
-
}
|
24
|
-
this.url = url;
|
25
|
-
this.properties = properties;
|
26
|
-
this.direct = direct;
|
27
|
-
}
|
28
|
-
|
29
|
-
@Override
|
30
|
-
public OracleOutputConnection connect(boolean autoCommit) throws SQLException
|
31
|
-
{
|
32
|
-
Connection c = DriverManager.getConnection(url, properties);
|
33
|
-
if (c == null) {
|
34
|
-
// driver.connect returns null when url is "jdbc:mysql://...".
|
35
|
-
throw new SQLException("Invalid url : " + url);
|
36
|
-
}
|
37
|
-
|
38
|
-
try {
|
39
|
-
OracleOutputConnection con = new OracleOutputConnection(c, autoCommit, direct);
|
40
|
-
c = null;
|
41
|
-
return con;
|
42
|
-
|
43
|
-
} finally {
|
44
|
-
if (c != null) {
|
45
|
-
c.close();
|
46
|
-
}
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
1
|
+
package org.embulk.output.oracle;
|
2
|
+
|
3
|
+
import java.sql.Connection;
|
4
|
+
import java.sql.DriverManager;
|
5
|
+
import java.sql.SQLException;
|
6
|
+
import java.util.Properties;
|
7
|
+
|
8
|
+
import org.embulk.output.jdbc.JdbcOutputConnector;
|
9
|
+
|
10
|
+
public class OracleOutputConnector
|
11
|
+
implements JdbcOutputConnector
|
12
|
+
{
|
13
|
+
private final String url;
|
14
|
+
private final Properties properties;
|
15
|
+
private final boolean direct;
|
16
|
+
|
17
|
+
public OracleOutputConnector(String url, Properties properties, boolean direct)
|
18
|
+
{
|
19
|
+
try {
|
20
|
+
Class.forName("oracle.jdbc.OracleDriver");
|
21
|
+
} catch (Exception ex) {
|
22
|
+
throw new RuntimeException(ex);
|
23
|
+
}
|
24
|
+
this.url = url;
|
25
|
+
this.properties = properties;
|
26
|
+
this.direct = direct;
|
27
|
+
}
|
28
|
+
|
29
|
+
@Override
|
30
|
+
public OracleOutputConnection connect(boolean autoCommit) throws SQLException
|
31
|
+
{
|
32
|
+
Connection c = DriverManager.getConnection(url, properties);
|
33
|
+
if (c == null) {
|
34
|
+
// driver.connect returns null when url is "jdbc:mysql://...".
|
35
|
+
throw new SQLException("Invalid url : " + url);
|
36
|
+
}
|
37
|
+
|
38
|
+
try {
|
39
|
+
OracleOutputConnection con = new OracleOutputConnection(c, autoCommit, direct);
|
40
|
+
c = null;
|
41
|
+
return con;
|
42
|
+
|
43
|
+
} finally {
|
44
|
+
if (c != null) {
|
45
|
+
c.close();
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
@@ -1,37 +1,37 @@
|
|
1
|
-
package org.embulk.output.oracle;
|
2
|
-
|
3
|
-
import java.sql.Timestamp;
|
4
|
-
import java.text.FieldPosition;
|
5
|
-
import java.text.SimpleDateFormat;
|
6
|
-
import java.util.Date;
|
7
|
-
|
8
|
-
|
9
|
-
public class TimestampFormat extends SimpleDateFormat
|
10
|
-
{
|
11
|
-
|
12
|
-
private final int scale;
|
13
|
-
|
14
|
-
public TimestampFormat(String pattern, int scale)
|
15
|
-
{
|
16
|
-
super(pattern);
|
17
|
-
|
18
|
-
this.scale = scale;
|
19
|
-
}
|
20
|
-
|
21
|
-
@Override
|
22
|
-
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
|
23
|
-
{
|
24
|
-
StringBuffer buffer = super.format(date, toAppendTo, pos);
|
25
|
-
if (scale > 0) {
|
26
|
-
buffer.append('.');
|
27
|
-
String nanos = Integer.toString(((Timestamp)date).getNanos());
|
28
|
-
int zeros = Math.min(scale, 9 - nanos.length());
|
29
|
-
for (int i = 0; i < zeros; i++) {
|
30
|
-
buffer.append('0');
|
31
|
-
}
|
32
|
-
buffer.append(nanos.substring(0, scale - zeros));
|
33
|
-
}
|
34
|
-
return buffer;
|
35
|
-
}
|
36
|
-
|
37
|
-
}
|
1
|
+
package org.embulk.output.oracle;
|
2
|
+
|
3
|
+
import java.sql.Timestamp;
|
4
|
+
import java.text.FieldPosition;
|
5
|
+
import java.text.SimpleDateFormat;
|
6
|
+
import java.util.Date;
|
7
|
+
|
8
|
+
|
9
|
+
public class TimestampFormat extends SimpleDateFormat
|
10
|
+
{
|
11
|
+
|
12
|
+
private final int scale;
|
13
|
+
|
14
|
+
public TimestampFormat(String pattern, int scale)
|
15
|
+
{
|
16
|
+
super(pattern);
|
17
|
+
|
18
|
+
this.scale = scale;
|
19
|
+
}
|
20
|
+
|
21
|
+
@Override
|
22
|
+
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
|
23
|
+
{
|
24
|
+
StringBuffer buffer = super.format(date, toAppendTo, pos);
|
25
|
+
if (scale > 0) {
|
26
|
+
buffer.append('.');
|
27
|
+
String nanos = Integer.toString(((Timestamp)date).getNanos());
|
28
|
+
int zeros = Math.min(scale, 9 - nanos.length());
|
29
|
+
for (int i = 0; i < zeros; i++) {
|
30
|
+
buffer.append('0');
|
31
|
+
}
|
32
|
+
buffer.append(nanos.substring(0, scale - zeros));
|
33
|
+
}
|
34
|
+
return buffer;
|
35
|
+
}
|
36
|
+
|
37
|
+
}
|
@@ -1,26 +1,26 @@
|
|
1
|
-
package org.embulk.output.oracle.oci;
|
2
|
-
|
3
|
-
public class ColumnDefinition
|
4
|
-
{
|
5
|
-
public static int SQLT_CHR = 1;
|
6
|
-
public static int SQLT_INT = 3;
|
7
|
-
|
8
|
-
public final String columnName;
|
9
|
-
public final int columnType;
|
10
|
-
public final int columnSize;
|
11
|
-
public final String columnDateFormat;
|
12
|
-
|
13
|
-
|
14
|
-
public ColumnDefinition(String columnName, int columnType, int columnSize, String columnDateFormat)
|
15
|
-
{
|
16
|
-
this.columnName = columnName;
|
17
|
-
this.columnType = columnType;
|
18
|
-
this.columnSize = columnSize;
|
19
|
-
this.columnDateFormat = columnDateFormat;
|
20
|
-
}
|
21
|
-
|
22
|
-
public ColumnDefinition(String columnName, int columnType, int columnSize)
|
23
|
-
{
|
24
|
-
this(columnName, columnType, columnSize, null);
|
25
|
-
}
|
26
|
-
}
|
1
|
+
package org.embulk.output.oracle.oci;
|
2
|
+
|
3
|
+
public class ColumnDefinition
|
4
|
+
{
|
5
|
+
public static int SQLT_CHR = 1;
|
6
|
+
public static int SQLT_INT = 3;
|
7
|
+
|
8
|
+
public final String columnName;
|
9
|
+
public final int columnType;
|
10
|
+
public final int columnSize;
|
11
|
+
public final String columnDateFormat;
|
12
|
+
|
13
|
+
|
14
|
+
public ColumnDefinition(String columnName, int columnType, int columnSize, String columnDateFormat)
|
15
|
+
{
|
16
|
+
this.columnName = columnName;
|
17
|
+
this.columnType = columnType;
|
18
|
+
this.columnSize = columnSize;
|
19
|
+
this.columnDateFormat = columnDateFormat;
|
20
|
+
}
|
21
|
+
|
22
|
+
public ColumnDefinition(String columnName, int columnType, int columnSize)
|
23
|
+
{
|
24
|
+
this(columnName, columnType, columnSize, null);
|
25
|
+
}
|
26
|
+
}
|