Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> binary data transfer (ORA_FFI, JDBC)
I would appreciate help to any of the following problems regarding
ORA_ForeignFunctionInterface and OracleJDBCDriver:
I have to develop C/C++ and Java encryption/decryption routines for a project that stores it's data in an ORACLE8 database. The Java applets communicate with the database through an OracleJDBCdriver. The C-DLLs are called via Foreign Function Interface from Developer2000FormsDesigner.Until now, VARCHAR2 is used for data storage. I encountered severe problems while trying to realize the data transfer. The source of the problems is, that VARCHAR2 is a character daty type, but encrypted data is binary.
The VARCHAR2 variable is interpreted as CHAR* in C++. It therefore seems impossible to allow 00-bytes in the encrypted data, since ORACLE interprets only the portion of the return string which is prior to the first \00. I could not find any way of calling C/C++ routines other than ORA_FFI. 2. Oracle Database > JDBC > Java and back again:
When executing SQL statements in Java (or preparedStatements) Java/JDBC maps the OracleCharacterSet to it's internal UNICODE format. This leads to a whole lot of question marks in the transmitted string when I try to read one which contains characters with ASCII-code above 7F(hex). I use method ResultSet.getString() for this. ResultSet.getBytes() throws an SQLException.
3. BLOBs and LONG RAWs
I can't create tables with blobs. Statements like the one offered by Thomas Kyte earlier in this discussion group won't work:
SQL> create table widgits
2 ( widgit_id number ,
3 widgit_data blob
4 );
widgit_data blob
*
Thanks for listening.
Andreas Jaeger
Institut für Geoinformatik, Universität Münster
Robert-Koch-Straße 26/28
D-48149 Münster
Tel.: (0251) 83 - 3 00 11
Fax: (0251) 83 - 3 97 63
mailto:jaeger_at_ifgi.uni-muenster.de
Andreas Jaeger
Hammer Straße 14
D-48153 Münster
Tel.: (0251) 53 37 78