embulk-output-oracle 0.4.5 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -50
  3. data/build.gradle +1 -0
  4. data/classpath/embulk-output-jdbc-0.5.0.jar +0 -0
  5. data/classpath/embulk-output-oracle-0.5.0.jar +0 -0
  6. data/src/main/java/org/embulk/output/oracle/DirectBatchInsert.java +16 -14
  7. data/src/main/java/org/embulk/output/oracle/OracleOutputConnection.java +5 -5
  8. data/src/main/java/org/embulk/output/oracle/oci/ColumnDefinition.java +39 -15
  9. data/src/main/java/org/embulk/output/oracle/oci/OCI.java +125 -133
  10. data/src/main/java/org/embulk/output/oracle/oci/OCIWrapper.java +403 -33
  11. data/src/main/java/org/embulk/output/oracle/oci/RowBuffer.java +39 -40
  12. data/src/main/java/org/embulk/output/oracle/oci/TableDefinition.java +17 -3
  13. data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTest.java +2 -2
  14. data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTestImpl.java +38 -143
  15. data/src/test/resources/{data → oracle/data}/test1/test1.csv +0 -0
  16. data/src/test/resources/{yml → oracle/yml}/test-insert-direct-direct-method.yml +1 -1
  17. data/src/test/resources/{yml → oracle/yml}/test-insert-direct-empty.yml +1 -1
  18. data/src/test/resources/{yml → oracle/yml}/test-insert-direct-oci-method-split.yml +1 -1
  19. data/src/test/resources/{yml → oracle/yml}/test-insert-direct-oci-method.yml +1 -1
  20. data/src/test/resources/{yml → oracle/yml}/test-insert-direct.yml +1 -1
  21. data/src/test/resources/{yml → oracle/yml}/test-insert-empty.yml +1 -1
  22. data/src/test/resources/{yml → oracle/yml}/test-insert.yml +1 -1
  23. data/src/test/resources/{yml → oracle/yml}/test-replace-empty.yml +1 -1
  24. data/src/test/resources/{yml → oracle/yml}/test-replace-long-name-multibyte.yml +1 -1
  25. data/src/test/resources/{yml → oracle/yml}/test-replace-long-name.yml +1 -1
  26. data/src/test/resources/{yml → oracle/yml}/test-replace-oci-method.yml +1 -1
  27. data/src/test/resources/{yml → oracle/yml}/test-replace.yml +1 -1
  28. data/src/test/resources/{yml → oracle/yml}/test-string-timestamp.yml +1 -1
  29. data/src/test/resources/{yml → oracle/yml}/test-truncate-insert-oci-method.yml +1 -1
  30. data/src/test/resources/{yml → oracle/yml}/test-truncate-insert.yml +1 -1
  31. data/src/test/resources/{yml → oracle/yml}/test-url.yml +1 -1
  32. metadata +21 -38
  33. data/classpath/embulk-output-jdbc-0.4.5.jar +0 -0
  34. data/classpath/embulk-output-oracle-0.4.5.jar +0 -0
  35. data/lib/embulk/linux_x64/libembulk-output-oracle.so +0 -0
  36. data/lib/embulk/win_x64/embulk-output-oracle.dll +0 -0
  37. data/src/main/cpp/common/dir-path-load.cpp +0 -425
  38. data/src/main/cpp/common/dir-path-load.h +0 -37
  39. data/src/main/cpp/common/embulk-output-oracle.cpp +0 -195
  40. data/src/main/cpp/common/org_embulk_output_oracle_oci_OCI.h +0 -77
  41. data/src/main/cpp/linux/build.sh +0 -21
  42. data/src/main/cpp/win/build.bat +0 -32
  43. data/src/main/cpp/win/dllmain.cpp +0 -25
  44. data/src/main/cpp/win/embulk-output-oracle.sln +0 -39
  45. data/src/main/cpp/win/embulk-output-oracle.vcxproj +0 -176
  46. data/src/test/cpp/common/embulk-output-oracle-test.cpp +0 -69
  47. data/src/test/cpp/linux/build.sh +0 -19
  48. data/src/test/cpp/win/build.bat +0 -29
  49. data/src/test/cpp/win/embulk-output-oracle-test.vcxproj +0 -155
  50. data/src/test/java/org/embulk/output/tester/EmbulkPluginTester.java +0 -79
  51. data/src/test/resources/dummy.txt +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f19ed247b3f0e55ae2a970607323439e04e5c83e
4
- data.tar.gz: 13955cf610304e6e53f1230cc99160b8d1c89439
3
+ metadata.gz: 7f22f18309d604502073834ef9bcac39ba1c7ed2
4
+ data.tar.gz: f4e47f7c177a3f8d99c0a6ebbc8eb7e3d5882417
5
5
  SHA512:
6
- metadata.gz: 57685288f87ed884e5f35358ed03f1c46f4cc1d030607842c8243fba31ed3913233f0c4d809b6d3793007daee8e7785b5f787c42ae40cf5c17e9bbd7373c669e
7
- data.tar.gz: 9ca1b2156ce837ad874f134b8fce9c2e809792498763655e02627236961e9363fd8ebfae5fa55a2f993ef3c24d82151e92351597687268269ebe964958258946
6
+ metadata.gz: f8791a70edae2c6af65682b2e96fb6186563509f7eff0d1c952d6e19b641e663e1f64624f4f57d441d4dc3d8efd8838d0006bc75c537b386c51fae3252e2ebdc
7
+ data.tar.gz: 713c24da25c5b10dcb47589ec5aa690ea6f64643961f3bf3273eed14bed835c23dec84e8c352bc3fcce04555c4ec00432334b850143fd53ec4f4861708760ecb
data/README.md CHANGED
@@ -61,10 +61,6 @@ It requires Oracle JDBC driver too, but the version 12 driver doesn't work (the
61
61
  It requires both Oracle JDBC driver and Oracle Instant Client (version 12.1.0.2.0).
62
62
  You must set the library loading path to the OCI library.
63
63
 
64
- If you use "oci", platform dependent library written in cpp is required.
65
- Windows(x64) library and Linux(x64) are bundled, but others are not bundled.
66
- You should build by yourself and set the library loading path to it.
67
-
68
64
  ### Example
69
65
 
70
66
  ```yaml
@@ -107,52 +103,6 @@ out:
107
103
  $ ./gradlew gem
108
104
  ```
109
105
 
110
- #### Build environment for native library
111
-
112
- For Windows (x64)
113
-
114
- (1) Install JDK.
115
-
116
- (2) Install Microsoft Visual Studio (only 2010 is tested).
117
-
118
- (3) Install Oracle Instant Client SDK 11.1.0.6.0 for Microsoft Windows (x64).
119
-
120
- (4) Set environment variables.
121
-
122
- * JAVA_HOME
123
- * OCI\_SDK_PATH ("sdk" directory of Oracle Instant Client)
124
-
125
- (5) Open src/main/cpp/win/embulk-output-oracle.sln by Visual Studio and build.
126
-
127
- For Windows command line, the following are needed in addition to (1) - (4).
128
-
129
- (6) Set environment variables.
130
-
131
- * MSVC_PATH (ex. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC)
132
- * MSSDK_PATH (ex. C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A)
133
-
134
- (7) Execute src/main/cpp/win/build.bat .
135
-
136
-
137
- For Linux (x64) (only Ubuntu Server 14.04 is tested)
138
-
139
- (1) Install JDK.
140
-
141
- (2) Install gcc and g++ .
142
-
143
- (3) Install Oracle Instant Client Basic and SDK 11.1.0.6.0 for Linux (x64).
144
-
145
- (4) Create symbolic links of OCI libraries.
146
-
147
- ln -s libocci.so.11.1 libocci.so
148
- ln -s libclntsh.so.11.1 libclntsh.so
149
-
150
- (5) Set environment variables.
151
-
152
- * JAVA_HOME
153
- * OCI_PATH (the directory of Oracle Instant Client Basic and the parent of the "sdk" directory)
154
-
155
- (6) Execute src/main/cpp/linux/build.sh .
156
106
 
157
107
  ***
158
108
  <img src="https://www.yourkit.com/images/yklogo.png" alt="YourKit"/> is used to improve performance of embulk-output-oracle.
data/build.gradle CHANGED
@@ -3,4 +3,5 @@
3
3
  dependencies {
4
4
  compile project(':embulk-output-jdbc')
5
5
  testCompile 'org.embulk:embulk-standards:0.8.0'
6
+ testCompile files('../embulk-output-jdbc/build/classes/test/')
6
7
  }
@@ -8,18 +8,20 @@ import java.text.DateFormat;
8
8
  import java.text.SimpleDateFormat;
9
9
  import java.util.ArrayList;
10
10
  import java.util.Arrays;
11
- import java.util.List;
12
11
  import java.util.Calendar;
12
+ import java.util.List;
13
+
13
14
  import org.embulk.output.jdbc.BatchInsert;
14
15
  import org.embulk.output.jdbc.JdbcColumn;
15
16
  import org.embulk.output.jdbc.JdbcSchema;
16
17
  import org.embulk.output.oracle.oci.ColumnDefinition;
18
+ import org.embulk.output.oracle.oci.OCI;
17
19
  import org.embulk.output.oracle.oci.OCIManager;
18
20
  import org.embulk.output.oracle.oci.OCIWrapper;
19
21
  import org.embulk.output.oracle.oci.RowBuffer;
20
22
  import org.embulk.output.oracle.oci.TableDefinition;
21
- import org.embulk.spi.time.Timestamp;
22
23
  import org.embulk.spi.Exec;
24
+ import org.embulk.spi.time.Timestamp;
23
25
  import org.slf4j.Logger;
24
26
 
25
27
  public class DirectBatchInsert implements BatchInsert
@@ -87,9 +89,9 @@ public class DirectBatchInsert implements BatchInsert
87
89
  case Types.LONGVARCHAR:
88
90
  case Types.CLOB:
89
91
  columns.add(new ColumnDefinition(insertColumn.getName(),
90
- ColumnDefinition.SQLT_CHR,
92
+ OCI.SQLT_CHR,
91
93
  insertColumn.getDataLength(),
92
- charset.getId()));
94
+ charset));
93
95
  break;
94
96
 
95
97
  case Types.NCHAR:
@@ -97,9 +99,9 @@ public class DirectBatchInsert implements BatchInsert
97
99
  case Types.LONGNVARCHAR:
98
100
  case Types.NCLOB:
99
101
  columns.add(new ColumnDefinition(insertColumn.getName(),
100
- ColumnDefinition.SQLT_CHR,
102
+ OCI.SQLT_CHR,
101
103
  insertColumn.getDataLength(),
102
- nationalCharset.getId()));
104
+ nationalCharset));
103
105
  break;
104
106
 
105
107
  case Types.DECIMAL:
@@ -110,9 +112,9 @@ public class DirectBatchInsert implements BatchInsert
110
112
  size += 1;
111
113
  }
112
114
  columns.add(new ColumnDefinition(insertColumn.getName(),
113
- ColumnDefinition.SQLT_CHR,
115
+ OCI.SQLT_CHR,
114
116
  size,
115
- charset.getId()));
117
+ charset));
116
118
  break;
117
119
 
118
120
  case Types.DATE:
@@ -130,9 +132,9 @@ public class DirectBatchInsert implements BatchInsert
130
132
  }
131
133
  formats[i] = javaFormat;
132
134
  columns.add(new ColumnDefinition(insertColumn.getName(),
133
- ColumnDefinition.SQLT_CHR,
135
+ OCI.SQLT_CHR,
134
136
  javaFormat.format(dummy).length(),
135
- charset.getId(),
137
+ charset,
136
138
  oracleFormat));
137
139
  break;
138
140
 
@@ -144,14 +146,14 @@ public class DirectBatchInsert implements BatchInsert
144
146
 
145
147
  rowSize = 0;
146
148
  for (ColumnDefinition column : columns) {
147
- rowSize += column.columnSize;
149
+ rowSize += column.getDataSize();
148
150
  }
149
151
 
150
152
  TableDefinition tableDefinition = new TableDefinition("\"" + loadTable + "\"", columns);
151
153
  ociKey = Arrays.asList(database, user, loadTable);
152
154
  ociManager.open(ociKey, database, user, password, tableDefinition);
153
155
 
154
- buffer = new RowBuffer(tableDefinition, Math.max(batchSize / rowSize, 8), charset.getJavaCharset());
156
+ buffer = new RowBuffer(tableDefinition, Math.max(batchSize / rowSize, 8));
155
157
  }
156
158
 
157
159
  @Override
@@ -186,7 +188,7 @@ public class DirectBatchInsert implements BatchInsert
186
188
 
187
189
  OCIWrapper oci = ociManager.get(ociKey);
188
190
  synchronized (oci) {
189
- oci.loadBuffer(buffer.getBuffer(), buffer.getRowCount());
191
+ oci.loadBuffer(buffer);
190
192
  }
191
193
 
192
194
  totalRows += buffer.getRowCount();
@@ -269,7 +271,7 @@ public class DirectBatchInsert implements BatchInsert
269
271
  @Override
270
272
  public void setNString(String v) throws IOException, SQLException
271
273
  {
272
- buffer.addValue(v, nationalCharset.getJavaCharset());
274
+ buffer.addValue(v);
273
275
  }
274
276
 
275
277
  @Override
@@ -137,7 +137,7 @@ public class OracleOutputConnection
137
137
  public synchronized OracleCharset getOracleCharset() throws SQLException
138
138
  {
139
139
  if (charset == null) {
140
- charset = getOracleCharset("NLS_CHARACTERSET", "UTF8");
140
+ charset = getOracleCharset("NLS_CHARACTERSET", "UTF8");
141
141
  }
142
142
  return charset;
143
143
  }
@@ -145,7 +145,7 @@ public class OracleOutputConnection
145
145
  public synchronized OracleCharset getOracleNationalCharset() throws SQLException
146
146
  {
147
147
  if (nationalCharset == null) {
148
- nationalCharset = getOracleCharset("NLS_NCHAR_CHARACTERSET", "AL16UTF16");
148
+ nationalCharset = getOracleCharset("NLS_NCHAR_CHARACTERSET", "AL16UTF16");
149
149
  }
150
150
  return nationalCharset;
151
151
  }
@@ -154,7 +154,7 @@ public class OracleOutputConnection
154
154
  {
155
155
  String charsetName = defaultCharsetName;
156
156
  try (PreparedStatement statement = connection.prepareStatement("SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER=?")) {
157
- statement.setString(1, parameterName);
157
+ statement.setString(1, parameterName);
158
158
  try (ResultSet resultSet = statement.executeQuery()) {
159
159
  if (resultSet.next()) {
160
160
  String nlsCharacterSet = resultSet.getString(1);
@@ -180,14 +180,14 @@ public class OracleOutputConnection
180
180
  }
181
181
 
182
182
 
183
- private static final String[] STANDARD_SIZE_TYPE_NAMES = {
183
+ private static final String[] SIZE_TYPE_NAMES = {
184
184
  "VARCHAR2", "NVARCHAR2",
185
185
  };
186
186
 
187
187
  @Override
188
188
  protected ColumnDeclareType getColumnDeclareType(String convertedTypeName, JdbcColumn col)
189
189
  {
190
- if (Arrays.asList(STANDARD_SIZE_TYPE_NAMES).contains(convertedTypeName)) {
190
+ if (Arrays.asList(SIZE_TYPE_NAMES).contains(convertedTypeName)) {
191
191
  return ColumnDeclareType.SIZE;
192
192
  }
193
193
  return super.getColumnDeclareType(convertedTypeName, col);
@@ -1,28 +1,52 @@
1
1
  package org.embulk.output.oracle.oci;
2
2
 
3
+ import org.embulk.output.oracle.OracleCharset;
4
+
3
5
  public class ColumnDefinition
4
6
  {
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 short charsetId;
12
- public final String columnDateFormat;
7
+ private final String columnName;
8
+ private final int dataType;
9
+ private final int dataSize;
10
+ private final OracleCharset charset;
11
+ private final String dateFormat;
13
12
 
14
13
 
15
- public ColumnDefinition(String columnName, int columnType, int columnSize, short charsetId, String columnDateFormat)
14
+ public ColumnDefinition(String columnName, int dataType, int dataSize, OracleCharset charset, String dateFormat)
16
15
  {
17
16
  this.columnName = columnName;
18
- this.columnType = columnType;
19
- this.columnSize = columnSize;
20
- this.charsetId = charsetId;
21
- this.columnDateFormat = columnDateFormat;
17
+ this.dataType = dataType;
18
+ this.dataSize = dataSize;
19
+ this.charset = charset;
20
+ this.dateFormat = dateFormat;
21
+ }
22
+
23
+ public ColumnDefinition(String columnName, int columnType, int columnSize, OracleCharset charset)
24
+ {
25
+ this(columnName, columnType, columnSize, charset, null);
26
+ }
27
+
28
+ public String getColumnName()
29
+ {
30
+ return columnName;
31
+ }
32
+
33
+ public int getDataType()
34
+ {
35
+ return dataType;
36
+ }
37
+
38
+ public int getDataSize()
39
+ {
40
+ return dataSize;
41
+ }
42
+
43
+ public OracleCharset getCharset()
44
+ {
45
+ return charset;
22
46
  }
23
47
 
24
- public ColumnDefinition(String columnName, int columnType, int columnSize, short charsetId)
48
+ public String getDateFormat()
25
49
  {
26
- this(columnName, columnType, columnSize, charsetId, null);
50
+ return dateFormat;
27
51
  }
28
52
  }
@@ -1,139 +1,131 @@
1
1
  package org.embulk.output.oracle.oci;
2
2
 
3
- import java.io.File;
4
- import java.io.IOException;
5
- import java.net.MalformedURLException;
6
- import java.net.URISyntaxException;
7
- import java.net.URL;
3
+ import jnr.ffi.Pointer;
4
+ import jnr.ffi.types.size_t;
5
+ import jnr.ffi.types.u_int16_t;
6
+ import jnr.ffi.types.u_int32_t;
7
+ import jnr.ffi.types.u_int8_t;
8
8
 
9
- import org.embulk.spi.Exec;
10
- import org.slf4j.Logger;
11
9
 
12
- import com.google.common.io.Files;
13
-
14
-
15
- public class OCI
10
+ public interface OCI
16
11
  {
17
- private static final Logger logger = Exec.getLogger(OCI.class);
18
-
19
- private static final String PLUGIN_NAME = "embulk-output-oracle";
20
-
21
- static {
22
- try {
23
- loadLibrary();
24
- } catch (URISyntaxException | IOException e) {
25
- throw new RuntimeException(e);
26
- }
27
- }
28
-
29
- public native byte[] createContext();
30
-
31
- public native byte[] getLasetMessage(byte[] context);
32
-
33
- public native boolean open(byte[] context, String dbName, String userName, String password);
34
-
35
- public native boolean prepareLoad(byte[] context, TableDefinition tableDefinition);
36
-
37
- public native boolean loadBuffer(byte[] context, byte[] buffer, int rowCount);
38
-
39
- public native boolean commit(byte[] context);
40
-
41
- public native boolean rollback(byte[] context);
42
-
43
- public native void close(byte[] context);
44
-
45
- private static void loadLibrary() throws URISyntaxException, IOException
46
- {
47
- loadLibrary(getPluginRoot());
48
- }
49
-
50
- private static File getPluginRoot() throws MalformedURLException, URISyntaxException
51
- {
52
- URL url = OCI.class.getResource("/" + OCI.class.getName().replace('.', '/') + ".class");
53
- if (url.toString().startsWith("jar:")) {
54
- url = new URL(url.toString().replaceAll("^jar:", "").replaceAll("![^!]*$", ""));
55
- }
56
-
57
- File folder = new File(url.toURI()).getParentFile();
58
- for (;; folder = folder.getParentFile()) {
59
- if (folder == null) {
60
- String message = String.format("OCI : %s folder not found.", PLUGIN_NAME);
61
- throw new RuntimeException(message);
62
- }
63
-
64
- if (folder.getName().startsWith(PLUGIN_NAME)) {
65
- return folder;
66
- }
67
- }
68
- }
69
-
70
- private static void loadLibrary(File folder) throws IOException
71
- {
72
- File lib = new File(new File(folder, "lib"), "embulk");
73
-
74
- String osName = System.getProperty("os.name");
75
- String osArch = System.getProperty("os.arch");
76
-
77
- String libraryName = System.mapLibraryName(PLUGIN_NAME);
78
- File libFolder = null;
79
-
80
- if (osName.startsWith("Windows")) {
81
- if (osArch.endsWith("64")) {
82
- libFolder = new File(lib, "win_x64");
83
- } else if (osArch.equals("x86")) {
84
- libFolder = new File(lib, "win_x86");
85
- }
86
- } else if (osName.equals("Linux")) {
87
- if (osArch.endsWith("64")) {
88
- libFolder = new File(lib, "linux_x64");
89
- } else if (osArch.equals("x86")) {
90
- libFolder = new File(lib, "linux_x86");
91
- }
92
- }
93
-
94
- if (libFolder == null) {
95
- logger.error(String.format("OCI : library \"%s\" for %s %s doesn't exist in lib folder.", libraryName, osName, osArch));
96
- return;
97
- }
98
-
99
- File libFile = new File(libFolder, libraryName);
100
- if (!libFile.exists()) {
101
- logger.error(String.format("OCI : library \"%s\" doesn't exist.", libFile.getAbsolutePath()));
102
- return;
103
- }
104
-
105
- logger.info(String.format("OCI : load library \"%s\".", libFile.getAbsolutePath()));
106
-
107
- File tempFolder = new File(lib, "temp");
108
- tempFolder.mkdirs();
109
-
110
- long currentTime = System.currentTimeMillis();
111
- File[] files = tempFolder.listFiles();
112
- if (files != null) {
113
- for (File file : files) {
114
- // delete old temporary files.
115
- // if another plugin is using a file, it cannot be deleted.
116
- // don't delete a recent file because another plugin may intend to use it.
117
- if (file.isFile() && file.getName().startsWith(PLUGIN_NAME) && file.lastModified() < currentTime - 60000) {
118
- file.delete();
119
- }
120
- }
121
- }
122
-
123
- String extension = libraryName.replaceAll("^[^\\.]*", "");
124
- for (int i = 0; i < 10; i++) {
125
- File tempLibFile = new File(tempFolder, PLUGIN_NAME + "-" + currentTime + "-" + i + extension);
126
- if (tempLibFile.createNewFile()) {
127
- // copy and load the library because different plugins cannot load the same library.
128
- logger.info(String.format("OCI : create temporary library \"%s\".", tempLibFile.getAbsolutePath()));
129
- Files.copy(libFile, tempLibFile);
130
- System.load(tempLibFile.getAbsolutePath());
131
- tempLibFile.deleteOnExit();
132
- // but may not be deleted because loaded as a library.
133
- return;
134
- }
135
- }
136
-
137
- logger.error("OCI : cannot create temporary library.");
138
- }
12
+ static short OCI_SUCCESS = 0;
13
+ static short OCI_ERROR = -1;
14
+ static short OCI_INVALID_HANDLE = -2;
15
+ static short OCI_NO_DATA = 100;
16
+ static short OCI_CONTINUE = -24200;
17
+
18
+
19
+ static int OCI_THREADED = 1;
20
+ static int OCI_OBJECT = 2;
21
+
22
+ static int OCI_HTYPE_ENV = 1;
23
+ static int OCI_HTYPE_ERROR = 2;
24
+ static int OCI_HTYPE_SVCCTX = 3;
25
+ static int OCI_HTYPE_DIRPATH_CTX = 14;
26
+ static int OCI_HTYPE_DIRPATH_COLUMN_ARRAY = 15;
27
+ static int OCI_HTYPE_DIRPATH_STREAM = 16;
28
+
29
+ static int OCI_ATTR_DATA_SIZE = 1;
30
+ static int OCI_ATTR_DATA_TYPE = 2;
31
+ static int OCI_ATTR_NAME = 4;
32
+ static int OCI_ATTR_ROW_COUNT = 9;
33
+ static int OCI_ATTR_CHARSET_ID = 31;
34
+ static int OCI_ATTR_DATEFORMAT = 75;
35
+ static int OCI_ATTR_NUM_ROWS = 81;
36
+ static int OCI_ATTR_NUM_COLS = 102;
37
+ static int OCI_ATTR_LIST_COLUMNS = 103;
38
+
39
+ static int OCI_DTYPE_PARAM = 53;
40
+
41
+ static byte OCI_DIRPATH_COL_COMPLETE = 0;
42
+
43
+ static int SQLT_CHR = 1;
44
+ static int SQLT_INT = 3;
45
+
46
+ short OCIErrorGet(Pointer hndlp,
47
+ @u_int32_t int recordno,
48
+ String sqlstate,
49
+ Pointer errcodep,
50
+ Pointer bufp,
51
+ @u_int32_t int bufsiz,
52
+ @u_int32_t int type);
53
+
54
+ short OCIEnvCreate(Pointer envp,
55
+ @u_int32_t int mode,
56
+ Pointer ctxp,
57
+ Pointer malocfp,
58
+ Pointer ralocfp,
59
+ Pointer mfreefp,
60
+ @size_t long xtramemSz,
61
+ Pointer usrmempp);
62
+
63
+ short OCIHandleAlloc(Pointer parenth,
64
+ Pointer hndlpp,
65
+ @u_int32_t int type,
66
+ @size_t long xtramemSz,
67
+ Pointer usrmempp);
68
+
69
+ short OCIHandleFree(Pointer hndlpp,
70
+ @u_int32_t int type);
71
+
72
+ short OCILogon(Pointer envhp,
73
+ Pointer errhp,
74
+ Pointer svchp,
75
+ String username,
76
+ @u_int32_t int usernameLen,
77
+ String password,
78
+ @u_int32_t int passwordLen,
79
+ String dbname,
80
+ @u_int32_t int dbnameLen);
81
+
82
+ short OCILogoff(Pointer svchp,
83
+ Pointer errhp);
84
+
85
+ short OCIAttrSet(Pointer trgthndlp,
86
+ @u_int32_t int trghndltyp,
87
+ Pointer attributep,
88
+ @u_int32_t int size,
89
+ @u_int32_t int attrtype,
90
+ Pointer errhp);
91
+
92
+ short OCIAttrGet(Pointer trgthndlp,
93
+ @u_int32_t int trghndltyp,
94
+ Pointer attributep,
95
+ Pointer sizep,
96
+ @u_int32_t int attrtype,
97
+ Pointer errhp);
98
+
99
+ short OCIParamGet(Pointer hndlp,
100
+ @u_int32_t int htype,
101
+ Pointer errhp,
102
+ Pointer parmdpp,
103
+ @u_int32_t int pos);
104
+
105
+ short OCIDescriptorFree(Pointer descp, @u_int32_t int type);
106
+
107
+ short OCIDirPathPrepare(Pointer dpctx, Pointer svchp, Pointer errhp);
108
+
109
+ short OCIDirPathColArrayEntrySet(Pointer dpca,
110
+ Pointer errhp,
111
+ @u_int32_t int rownum,
112
+ @u_int16_t short colIdx,
113
+ Pointer cvalp,
114
+ @u_int32_t int size,
115
+ @u_int8_t byte cflg);
116
+
117
+ short OCIDirPathStreamReset(Pointer dpstr, Pointer errhp);
118
+
119
+ short OCIDirPathColArrayToStream(Pointer dpca,
120
+ Pointer dpctx,
121
+ Pointer dpstr,
122
+ Pointer errhp,
123
+ @u_int32_t int rowcnt,
124
+ @u_int32_t int rowoff);
125
+
126
+ short OCIDirPathLoadStream(Pointer dpctx, Pointer dpstr, Pointer errhp);
127
+
128
+ short OCIDirPathFinish(Pointer dpctx, Pointer errhp);
129
+
130
+ short OCIDirPathAbort(Pointer dpctx, Pointer errhp);
139
131
  }