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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +155 -110
  3. data/build.gradle +6 -6
  4. data/classpath/embulk-output-jdbc-0.3.0.jar +0 -0
  5. data/classpath/embulk-output-oracle-0.3.0.jar +0 -0
  6. data/lib/embulk/output/oracle.rb +3 -3
  7. data/src/main/cpp/common/dir-path-load.cpp +424 -424
  8. data/src/main/cpp/common/dir-path-load.h +36 -36
  9. data/src/main/cpp/common/embulk-output-oracle.cpp +196 -196
  10. data/src/main/cpp/common/org_embulk_output_oracle_oci_OCI.h +77 -77
  11. data/src/main/cpp/linux/build.sh +21 -21
  12. data/src/main/cpp/win/build.bat +31 -31
  13. data/src/main/cpp/win/dllmain.cpp +25 -25
  14. data/src/main/cpp/win/embulk-output-oracle.sln +39 -39
  15. data/src/main/cpp/win/embulk-output-oracle.vcxproj +175 -175
  16. data/src/main/java/org/embulk/output/OracleOutputPlugin.java +22 -66
  17. data/src/main/java/org/embulk/output/oracle/DirectBatchInsert.java +289 -289
  18. data/src/main/java/org/embulk/output/oracle/InsertMethod.java +8 -8
  19. data/src/main/java/org/embulk/output/oracle/OracleCharset.java +32 -19
  20. data/src/main/java/org/embulk/output/oracle/OracleOutputConnection.java +165 -134
  21. data/src/main/java/org/embulk/output/oracle/OracleOutputConnector.java +49 -49
  22. data/src/main/java/org/embulk/output/oracle/TimestampFormat.java +37 -37
  23. data/src/main/java/org/embulk/output/oracle/oci/ColumnDefinition.java +26 -26
  24. data/src/main/java/org/embulk/output/oracle/oci/OCI.java +139 -139
  25. data/src/main/java/org/embulk/output/oracle/oci/OCIManager.java +64 -64
  26. data/src/main/java/org/embulk/output/oracle/oci/OCIWrapper.java +96 -96
  27. data/src/main/java/org/embulk/output/oracle/oci/RowBuffer.java +99 -99
  28. data/src/main/java/org/embulk/output/oracle/oci/TableDefinition.java +24 -24
  29. data/src/test/cpp/common/embulk-output-oracle-test.cpp +69 -69
  30. data/src/test/cpp/linux/build.sh +19 -19
  31. data/src/test/cpp/win/build.bat +28 -28
  32. data/src/test/cpp/win/embulk-output-oracle-test.vcxproj +154 -154
  33. data/src/test/java/org/embulk/input/filesplit/LocalFileSplitInputPlugin.java +187 -187
  34. data/src/test/java/org/embulk/input/filesplit/PartialFile.java +49 -49
  35. data/src/test/java/org/embulk/input/filesplit/PartialFileInputStream.java +154 -154
  36. data/src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java +42 -42
  37. data/src/test/java/org/embulk/output/oracle/EmbulkPluginTester.java +120 -120
  38. data/src/test/java/org/embulk/output/oracle/EmptyConfigSource.java +100 -100
  39. data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTest.java +172 -161
  40. data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTestImpl.java +445 -413
  41. data/src/test/java/org/embulk/output/oracle/TimestampFormatTest.java +57 -57
  42. data/src/test/resources/data/test1/test1.csv +3 -3
  43. data/src/test/resources/yml/test-insert-direct.yml +26 -26
  44. data/src/test/resources/yml/test-insert-oci-split.yml +26 -26
  45. data/src/test/resources/yml/test-insert-oci.yml +26 -26
  46. data/src/test/resources/yml/test-insert.yml +25 -25
  47. data/src/test/resources/yml/test-replace-long-name-multibyte.yml +25 -0
  48. data/src/test/resources/yml/test-replace-long-name.yml +25 -25
  49. data/src/test/resources/yml/test-replace.yml +25 -25
  50. data/src/test/resources/yml/test-string-timestamp.yml +25 -0
  51. data/src/test/resources/yml/test-url.yml +24 -24
  52. metadata +6 -5
  53. data/classpath/embulk-output-jdbc-0.2.4.jar +0 -0
  54. data/classpath/embulk-output-oracle-0.2.4.jar +0 -0
  55. data/src/main/java/org/embulk/output/oracle/setter/OracleColumnSetterFactory.java +0 -31
@@ -1,289 +1,289 @@
1
- package org.embulk.output.oracle;
2
-
3
- import java.io.IOException;
4
- import java.math.BigDecimal;
5
- import java.sql.Date;
6
- import java.sql.SQLException;
7
- import java.sql.Time;
8
- import java.sql.Timestamp;
9
- import java.sql.Types;
10
- import java.text.DateFormat;
11
- import java.text.SimpleDateFormat;
12
- import java.util.ArrayList;
13
- import java.util.Arrays;
14
- import java.util.List;
15
-
16
- import org.embulk.output.jdbc.BatchInsert;
17
- import org.embulk.output.jdbc.JdbcColumn;
18
- import org.embulk.output.jdbc.JdbcSchema;
19
- import org.embulk.output.oracle.oci.ColumnDefinition;
20
- import org.embulk.output.oracle.oci.OCIManager;
21
- import org.embulk.output.oracle.oci.OCIWrapper;
22
- import org.embulk.output.oracle.oci.RowBuffer;
23
- import org.embulk.output.oracle.oci.TableDefinition;
24
- import org.embulk.spi.Exec;
25
- import org.slf4j.Logger;
26
-
27
- public class DirectBatchInsert implements BatchInsert
28
- {
29
- private static OCIManager ociManager = new OCIManager();
30
-
31
- private final Logger logger = Exec.getLogger(DirectBatchInsert.class);
32
-
33
- private final List<String> ociKey;
34
- private final String database;
35
- private final String user;
36
- private final String password;
37
- private final String table;
38
- private final OracleCharset charset;
39
- private final int batchSize;
40
- private RowBuffer buffer;
41
- private long totalRows;
42
- private int rowSize;
43
- private int batchWeight;
44
-
45
- private DateFormat[] formats;
46
-
47
-
48
- public DirectBatchInsert(String database, String user, String password, String table, OracleCharset charset, int batchSize)
49
- {
50
- this.database = database;
51
- this.user = user;
52
- this.password = password;
53
- this.table = table;
54
- this.charset = charset;
55
- this.batchSize = batchSize;
56
-
57
- ociKey = Arrays.asList(database, user, table);
58
- }
59
-
60
- @Override
61
- public void prepare(String loadTable, JdbcSchema insertSchema) throws SQLException
62
- {
63
-
64
- /*
65
- * available mappings
66
- *
67
- * boolean -> unused
68
- * byte -> unused
69
- * short -> unused
70
- * int -> unused
71
- * long -> unused
72
- * BigDecimal -> unused
73
- * String -> CHAR,VARCHAR,LONGVARCHAR,CLOB, NCHAR,NVARCHAR,NCLOB, NUMBER
74
- * NString -> unused
75
- * bytes -> unused
76
- * SqlDate -> unused
77
- * SqlTime -> unused
78
- * SqlTimeStamp -> TIMESTAMP
79
- *
80
- */
81
-
82
- formats = new DateFormat[insertSchema.getCount()];
83
- List<ColumnDefinition> columns = new ArrayList<ColumnDefinition>();
84
- Timestamp dummy = new Timestamp(System.currentTimeMillis());
85
- for (int i = 0; i < insertSchema.getCount(); i++) {
86
- JdbcColumn insertColumn = insertSchema.getColumn(i);
87
- switch (insertColumn.getSqlType()) {
88
- case Types.CHAR:
89
- case Types.VARCHAR:
90
- case Types.LONGVARCHAR:
91
- case Types.CLOB:
92
- // TODO: CHAR(n CHAR)
93
- columns.add(new ColumnDefinition(insertColumn.getName(),
94
- ColumnDefinition.SQLT_CHR,
95
- insertColumn.getSizeTypeParameter()));
96
- break;
97
-
98
- case Types.DECIMAL:
99
- // sign + size
100
- int size = 1 + insertColumn.getSizeTypeParameter();
101
- if (insertColumn.getSizeTypeParameter() > 0) {
102
- // decimal point
103
- size += 1;
104
- }
105
- columns.add(new ColumnDefinition(insertColumn.getName(),
106
- ColumnDefinition.SQLT_CHR,
107
- size));
108
- break;
109
-
110
- case Types.DATE:
111
- break;
112
-
113
- case Types.TIMESTAMP:
114
- String oracleFormat;
115
- DateFormat javaFormat;
116
- if (insertColumn.getTypeName().equals("DATE")) {
117
- oracleFormat = "YYYY-MM-DD HH24:MI:SS";
118
- javaFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
119
- } else {
120
- oracleFormat = "YYYY-MM-DD HH24:MI:SS.FF9";
121
- javaFormat = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
122
- }
123
- formats[i] = javaFormat;
124
- columns.add(new ColumnDefinition(insertColumn.getName(),
125
- ColumnDefinition.SQLT_CHR,
126
- javaFormat.format(dummy).length(),
127
- oracleFormat));
128
- break;
129
-
130
- default:
131
- throw new SQLException("Unsupported type : " + insertColumn.getTypeName());
132
- }
133
-
134
- }
135
-
136
- rowSize = 0;
137
- for (ColumnDefinition column : columns) {
138
- rowSize += column.columnSize;
139
- }
140
-
141
- TableDefinition tableDefinition = new TableDefinition(table, charset.charstId, columns);
142
- ociManager.open(ociKey, database, user, password, tableDefinition);
143
-
144
- buffer = new RowBuffer(tableDefinition, Math.max(batchSize / rowSize, 8), charset.javaCharset);
145
- }
146
-
147
- @Override
148
- public int getBatchWeight()
149
- {
150
- return batchWeight;
151
- }
152
-
153
- @Override
154
- public void add() throws IOException, SQLException
155
- {
156
- batchWeight += rowSize;
157
- if (buffer.isFull()) {
158
- flush();
159
- }
160
- }
161
-
162
- @Override
163
- public void close() throws IOException, SQLException
164
- {
165
- ociManager.close(ociKey);
166
- }
167
-
168
- @Override
169
- public void flush() throws IOException, SQLException
170
- {
171
- if (buffer.getRowCount() > 0) {
172
- try {
173
- logger.info(String.format("Loading %,d rows", buffer.getRowCount()));
174
-
175
- long startTime = System.currentTimeMillis();
176
-
177
- OCIWrapper oci = ociManager.get(ociKey);
178
- synchronized (oci) {
179
- oci.loadBuffer(buffer.getBuffer(), buffer.getRowCount());
180
- }
181
-
182
- totalRows += buffer.getRowCount();
183
- double seconds = (System.currentTimeMillis() - startTime) / 1000.0;
184
- logger.info(String.format("> %.2f seconds (loaded %,d rows in total)", seconds, totalRows));
185
-
186
- } finally {
187
- buffer.clear();
188
- batchWeight = 0;
189
- }
190
- }
191
- }
192
-
193
- @Override
194
- public void finish() throws IOException, SQLException
195
- {
196
- flush();
197
- }
198
-
199
- @Override
200
- public void setNull(int sqlType) throws IOException, SQLException
201
- {
202
- buffer.addValue("");
203
- }
204
-
205
- @Override
206
- public void setBoolean(boolean v) throws IOException, SQLException
207
- {
208
- throw new SQLException("Unsupported");
209
- }
210
-
211
- @Override
212
- public void setByte(byte v) throws IOException, SQLException
213
- {
214
- throw new SQLException("Unsupported");
215
- }
216
-
217
- @Override
218
- public void setShort(short v) throws IOException, SQLException
219
- {
220
- throw new SQLException("Unsupported");
221
- }
222
-
223
- @Override
224
- public void setInt(int v) throws IOException, SQLException
225
- {
226
- buffer.addValue(v);
227
- }
228
-
229
- @Override
230
- public void setLong(long v) throws IOException, SQLException
231
- {
232
- buffer.addValue(Long.toString(v));
233
- }
234
-
235
- @Override
236
- public void setFloat(float v) throws IOException, SQLException
237
- {
238
- throw new SQLException("Unsupported");
239
- }
240
-
241
- @Override
242
- public void setDouble(double v) throws IOException, SQLException
243
- {
244
- throw new SQLException("Unsupported");
245
- }
246
-
247
- @Override
248
- public void setBigDecimal(BigDecimal v) throws IOException, SQLException
249
- {
250
- throw new SQLException("Unsupported");
251
- }
252
-
253
- @Override
254
- public void setString(String v) throws IOException, SQLException
255
- {
256
- buffer.addValue(v);
257
- }
258
-
259
- @Override
260
- public void setNString(String v) throws IOException, SQLException
261
- {
262
- throw new SQLException("Unsupported");
263
- }
264
-
265
- @Override
266
- public void setBytes(byte[] v) throws IOException, SQLException
267
- {
268
- throw new SQLException("Unsupported");
269
- }
270
-
271
- @Override
272
- public void setSqlDate(Date v, int sqlType) throws IOException, SQLException
273
- {
274
- throw new SQLException("Unsupported");
275
- }
276
-
277
- @Override
278
- public void setSqlTime(Time v, int sqlType) throws IOException, SQLException
279
- {
280
- throw new SQLException("Unsupported");
281
- }
282
-
283
- @Override
284
- public void setSqlTimestamp(Timestamp v, int sqlType) throws IOException, SQLException
285
- {
286
- buffer.addValue(formats[buffer.getCurrentColumn()].format(v));
287
- }
288
-
289
- }
1
+ package org.embulk.output.oracle;
2
+
3
+ import java.io.IOException;
4
+ import java.math.BigDecimal;
5
+ import java.sql.Date;
6
+ import java.sql.SQLException;
7
+ import java.sql.Time;
8
+ import java.sql.Timestamp;
9
+ import java.sql.Types;
10
+ import java.text.DateFormat;
11
+ import java.text.SimpleDateFormat;
12
+ import java.util.ArrayList;
13
+ import java.util.Arrays;
14
+ import java.util.List;
15
+
16
+ import org.embulk.output.jdbc.BatchInsert;
17
+ import org.embulk.output.jdbc.JdbcColumn;
18
+ import org.embulk.output.jdbc.JdbcSchema;
19
+ import org.embulk.output.oracle.oci.ColumnDefinition;
20
+ import org.embulk.output.oracle.oci.OCIManager;
21
+ import org.embulk.output.oracle.oci.OCIWrapper;
22
+ import org.embulk.output.oracle.oci.RowBuffer;
23
+ import org.embulk.output.oracle.oci.TableDefinition;
24
+ import org.embulk.spi.Exec;
25
+ import org.slf4j.Logger;
26
+
27
+ public class DirectBatchInsert implements BatchInsert
28
+ {
29
+ private static OCIManager ociManager = new OCIManager();
30
+
31
+ private final Logger logger = Exec.getLogger(DirectBatchInsert.class);
32
+
33
+ private final List<String> ociKey;
34
+ private final String database;
35
+ private final String user;
36
+ private final String password;
37
+ private final String table;
38
+ private final OracleCharset charset;
39
+ private final int batchSize;
40
+ private RowBuffer buffer;
41
+ private long totalRows;
42
+ private int rowSize;
43
+ private int batchWeight;
44
+
45
+ private DateFormat[] formats;
46
+
47
+
48
+ public DirectBatchInsert(String database, String user, String password, String table, OracleCharset charset, int batchSize)
49
+ {
50
+ this.database = database;
51
+ this.user = user;
52
+ this.password = password;
53
+ this.table = table;
54
+ this.charset = charset;
55
+ this.batchSize = batchSize;
56
+
57
+ ociKey = Arrays.asList(database, user, table);
58
+ }
59
+
60
+ @Override
61
+ public void prepare(String loadTable, JdbcSchema insertSchema) throws SQLException
62
+ {
63
+
64
+ /*
65
+ * available mappings
66
+ *
67
+ * boolean -> unused
68
+ * byte -> unused
69
+ * short -> unused
70
+ * int -> unused
71
+ * long -> unused
72
+ * BigDecimal -> unused
73
+ * String -> CHAR,VARCHAR,LONGVARCHAR,CLOB, NCHAR,NVARCHAR,NCLOB, NUMBER
74
+ * NString -> unused
75
+ * bytes -> unused
76
+ * SqlDate -> unused
77
+ * SqlTime -> unused
78
+ * SqlTimeStamp -> TIMESTAMP
79
+ *
80
+ */
81
+
82
+ formats = new DateFormat[insertSchema.getCount()];
83
+ List<ColumnDefinition> columns = new ArrayList<ColumnDefinition>();
84
+ Timestamp dummy = new Timestamp(System.currentTimeMillis());
85
+ for (int i = 0; i < insertSchema.getCount(); i++) {
86
+ JdbcColumn insertColumn = insertSchema.getColumn(i);
87
+ switch (insertColumn.getSqlType()) {
88
+ case Types.CHAR:
89
+ case Types.VARCHAR:
90
+ case Types.LONGVARCHAR:
91
+ case Types.CLOB:
92
+ // TODO: CHAR(n CHAR)
93
+ columns.add(new ColumnDefinition(insertColumn.getName(),
94
+ ColumnDefinition.SQLT_CHR,
95
+ insertColumn.getSizeTypeParameter()));
96
+ break;
97
+
98
+ case Types.DECIMAL:
99
+ // sign + size
100
+ int size = 1 + insertColumn.getSizeTypeParameter();
101
+ if (insertColumn.getSizeTypeParameter() > 0) {
102
+ // decimal point
103
+ size += 1;
104
+ }
105
+ columns.add(new ColumnDefinition(insertColumn.getName(),
106
+ ColumnDefinition.SQLT_CHR,
107
+ size));
108
+ break;
109
+
110
+ case Types.DATE:
111
+ break;
112
+
113
+ case Types.TIMESTAMP:
114
+ String oracleFormat;
115
+ DateFormat javaFormat;
116
+ if (insertColumn.getSimpleTypeName().equals("DATE")) {
117
+ oracleFormat = "YYYY-MM-DD HH24:MI:SS";
118
+ javaFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
119
+ } else {
120
+ oracleFormat = "YYYY-MM-DD HH24:MI:SS.FF9";
121
+ javaFormat = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
122
+ }
123
+ formats[i] = javaFormat;
124
+ columns.add(new ColumnDefinition(insertColumn.getName(),
125
+ ColumnDefinition.SQLT_CHR,
126
+ javaFormat.format(dummy).length(),
127
+ oracleFormat));
128
+ break;
129
+
130
+ default:
131
+ throw new SQLException("Unsupported type : " + insertColumn.getSimpleTypeName());
132
+ }
133
+
134
+ }
135
+
136
+ rowSize = 0;
137
+ for (ColumnDefinition column : columns) {
138
+ rowSize += column.columnSize;
139
+ }
140
+
141
+ TableDefinition tableDefinition = new TableDefinition(table, charset.getId(), columns);
142
+ ociManager.open(ociKey, database, user, password, tableDefinition);
143
+
144
+ buffer = new RowBuffer(tableDefinition, Math.max(batchSize / rowSize, 8), charset.getJavaCharset());
145
+ }
146
+
147
+ @Override
148
+ public int getBatchWeight()
149
+ {
150
+ return batchWeight;
151
+ }
152
+
153
+ @Override
154
+ public void add() throws IOException, SQLException
155
+ {
156
+ batchWeight += rowSize;
157
+ if (buffer.isFull()) {
158
+ flush();
159
+ }
160
+ }
161
+
162
+ @Override
163
+ public void close() throws IOException, SQLException
164
+ {
165
+ ociManager.close(ociKey);
166
+ }
167
+
168
+ @Override
169
+ public void flush() throws IOException, SQLException
170
+ {
171
+ if (buffer.getRowCount() > 0) {
172
+ try {
173
+ logger.info(String.format("Loading %,d rows", buffer.getRowCount()));
174
+
175
+ long startTime = System.currentTimeMillis();
176
+
177
+ OCIWrapper oci = ociManager.get(ociKey);
178
+ synchronized (oci) {
179
+ oci.loadBuffer(buffer.getBuffer(), buffer.getRowCount());
180
+ }
181
+
182
+ totalRows += buffer.getRowCount();
183
+ double seconds = (System.currentTimeMillis() - startTime) / 1000.0;
184
+ logger.info(String.format("> %.2f seconds (loaded %,d rows in total)", seconds, totalRows));
185
+
186
+ } finally {
187
+ buffer.clear();
188
+ batchWeight = 0;
189
+ }
190
+ }
191
+ }
192
+
193
+ @Override
194
+ public void finish() throws IOException, SQLException
195
+ {
196
+ flush();
197
+ }
198
+
199
+ @Override
200
+ public void setNull(int sqlType) throws IOException, SQLException
201
+ {
202
+ buffer.addValue("");
203
+ }
204
+
205
+ @Override
206
+ public void setBoolean(boolean v) throws IOException, SQLException
207
+ {
208
+ throw new SQLException("Unsupported");
209
+ }
210
+
211
+ @Override
212
+ public void setByte(byte v) throws IOException, SQLException
213
+ {
214
+ throw new SQLException("Unsupported");
215
+ }
216
+
217
+ @Override
218
+ public void setShort(short v) throws IOException, SQLException
219
+ {
220
+ throw new SQLException("Unsupported");
221
+ }
222
+
223
+ @Override
224
+ public void setInt(int v) throws IOException, SQLException
225
+ {
226
+ buffer.addValue(v);
227
+ }
228
+
229
+ @Override
230
+ public void setLong(long v) throws IOException, SQLException
231
+ {
232
+ buffer.addValue(Long.toString(v));
233
+ }
234
+
235
+ @Override
236
+ public void setFloat(float v) throws IOException, SQLException
237
+ {
238
+ throw new SQLException("Unsupported");
239
+ }
240
+
241
+ @Override
242
+ public void setDouble(double v) throws IOException, SQLException
243
+ {
244
+ throw new SQLException("Unsupported");
245
+ }
246
+
247
+ @Override
248
+ public void setBigDecimal(BigDecimal v) throws IOException, SQLException
249
+ {
250
+ throw new SQLException("Unsupported");
251
+ }
252
+
253
+ @Override
254
+ public void setString(String v) throws IOException, SQLException
255
+ {
256
+ buffer.addValue(v);
257
+ }
258
+
259
+ @Override
260
+ public void setNString(String v) throws IOException, SQLException
261
+ {
262
+ throw new SQLException("Unsupported");
263
+ }
264
+
265
+ @Override
266
+ public void setBytes(byte[] v) throws IOException, SQLException
267
+ {
268
+ throw new SQLException("Unsupported");
269
+ }
270
+
271
+ @Override
272
+ public void setSqlDate(Date v, int sqlType) throws IOException, SQLException
273
+ {
274
+ throw new SQLException("Unsupported");
275
+ }
276
+
277
+ @Override
278
+ public void setSqlTime(Time v, int sqlType) throws IOException, SQLException
279
+ {
280
+ throw new SQLException("Unsupported");
281
+ }
282
+
283
+ @Override
284
+ public void setSqlTimestamp(Timestamp v, int sqlType) throws IOException, SQLException
285
+ {
286
+ buffer.addValue(formats[buffer.getCurrentColumn()].format(v));
287
+ }
288
+
289
+ }
@@ -1,8 +1,8 @@
1
- package org.embulk.output.oracle;
2
-
3
- public enum InsertMethod
4
- {
5
- normal,
6
- direct,
7
- oci;
8
- }
1
+ package org.embulk.output.oracle;
2
+
3
+ public enum InsertMethod
4
+ {
5
+ normal,
6
+ direct,
7
+ oci;
8
+ }
@@ -1,19 +1,32 @@
1
- package org.embulk.output.oracle;
2
-
3
- import java.nio.charset.Charset;
4
-
5
- public class OracleCharset
6
- {
7
- public final String charsetName;
8
- public final short charstId;
9
- public final Charset javaCharset;
10
-
11
-
12
- public OracleCharset(String charsetName, short charstId, Charset javaCharset)
13
- {
14
- this.charsetName = charsetName;
15
- this.charstId = charstId;
16
- this.javaCharset = javaCharset;
17
- }
18
-
19
- }
1
+ package org.embulk.output.oracle;
2
+
3
+ import java.nio.charset.Charset;
4
+
5
+ public class OracleCharset
6
+ {
7
+ private final String name;
8
+ private final short id;
9
+ private final Charset javaCharset;
10
+
11
+ public OracleCharset(String name, short id, Charset javaCharset)
12
+ {
13
+ this.name = name;
14
+ this.id = id;
15
+ this.javaCharset = javaCharset;
16
+ }
17
+
18
+ public String getName()
19
+ {
20
+ return name;
21
+ }
22
+
23
+ public short getId()
24
+ {
25
+ return id;
26
+ }
27
+
28
+ public Charset getJavaCharset()
29
+ {
30
+ return javaCharset;
31
+ }
32
+ }