BLOB JDBC/OCI8 and dbms_lob.read

Hi,
using dbms_lob.read() to retrieve a BLOB with JDBC/OCI8
we cannot use a chunk larger than 255.
If we try, we get a 21560 error.
Any idea?
Thanks
Herve
null

Thanks for your quick answer.
I tried it, but doing so, it doubles those characters coming from RAW format to VARCHAR2, and I've got a PNG-file that no picture-viewer shows, not even as garbage as was with CAST_TO_VARCHAR
file size is now 44246 bytes and debug-output from loop is:
chunk no:1 chunk size: 8192 chunksize in bytes: 8192
chunk no:2 chunk size: 8192 chunksize in bytes: 8192
chunk no:3 chunk size: 8192 chunksize in bytes: 8192
chunk no:4 chunk size: 8192 chunksize in bytes: 8192
chunk no:5 chunk size: 8192 chunksize in bytes: 8192
chunk no:6 chunk size: 3286 chunksize in bytes: 3286
whole chunk-size: 44246 in bytes: 44246
Anymore ideas?

Similar Messages

  • Jdbc (oci8) and database link ?

    hello,
    i try to select * from dual@DBNAME within a jdbc connection.
    1. we are connected with oci8 on a 9.2.0 database
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    String urlDefault = "jdbc:oracle:oci8:@DBM1.uvwendy";
    String url = null;
    2. then we prepare a statement
    rset=dblink_stmt.executeQuery ("select name from v$database@"+Database_Server+"_"+Database_SID+".UVDBM");
    while (rset.next ())
    System.out.println (rset.getString (1));
    } catch (SQLException e) {
    System.out.println ("Error REMOTE SELECT ..." + e);
    3. the error looks like this
    select name from v$database@UVGENEVA_GENEVADB.UVDBM
    Error REMOTE SELECT ...java.sql.SQLException: ORA-12154: TNS:could not resolve service name
    but when we execute the same statement in the database self then it works fine.
    the database link works fine.
    has anybody an idea for this behaviour?
    thank you very much,
    wolfgang

    hello,
    i try to select * from dual@DBNAME within a jdbc connection.
    1. we are connected with oci8 on a 9.2.0 database
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    String urlDefault = "jdbc:oracle:oci8:@DBM1.uvwendy";
    String url = null;
    2. then we prepare a statement
    rset=dblink_stmt.executeQuery ("select name from v$database@"+Database_Server+"_"+Database_SID+".UVDBM");
    while (rset.next ())
    System.out.println (rset.getString (1));
    } catch (SQLException e) {
    System.out.println ("Error REMOTE SELECT ..." + e);
    3. the error looks like this
    select name from v$database@UVGENEVA_GENEVADB.UVDBM
    Error REMOTE SELECT ...java.sql.SQLException: ORA-12154: TNS:could not resolve service name
    but when we execute the same statement in the database self then it works fine.
    the database link works fine.
    has anybody an idea for this behaviour?
    thank you very much,
    wolfgang

  • Jdbc/oci8 oracore8.dll problem

    Hi,
    I am using jdbc oci8 and facing the following problem.
    Server: Oracle 8.1.6.0.0 on Solaris
    JDK : JDK 1.2
    Driver: JDBC oci8
    Client: Oracle Client 8.1.5 on Windows NT
    With jdbc thin driver, I am able to connect to the database.
    But with JDBC OCI8, I am getting the following error:
    THE PROCEDURE ENTRY POINT SLZSETEVAR COULD NOT BE LOCATED IN ORACORE.DLL.
    My connection string is
    Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@13.205.104.22:1521:dssdev2", "scott", "tiger");
    I have two questions.
    1. Is it possible to use jdbc oci8 driver for the configuration which I have?
    2. If yes, how do I get rid of this problem?
    Any help will be deeply appreciated.
    Thanks.
    null

    Hi ,
    I am facing the same problem with
    Oracle 8.1.5 on Windows NT.
    Driver : 8.1.6 JDBC OCI Driver
    JDK 1.2.2
    Any workaround / patch to solve this problem please ?
    Thanks,
    Shubhada

  • Reading a Blob (CSV file) and displaying the contents

    Hello Experts,
    I’m currently working on a system that allows the users to upload an Excel spreadsheet (.xls) in the system. The upload page is a PL/SQL cartridge. Then I’ve written a Java servlet (using Oracle Clean Content) to convert the XLS into a CSV and store it back in the database. (it is stored in the “uploaded_files” table as a blob). I’m trying to create another procedure to read the contents of the blob and display a preview of the data on the screen (using an html table (will be done using cartridge)). After the preview, the user can choose to submit the data into the database into the “detail_records” table or simply discard everything.
    Can anyone provide me any guidelines and/or code samples for reading the contents of a blob and displaying it as an html table? My data contains about 10 rows and 20 columns in the spreadsheet. I’ve been looking into using associative arrays or nested tables but I’m getting confused about how to implement them in my situation.
    Any help is greatly appreciated.

    BluShadow,
    Thanks for your response. The reason that it is a blob is that we use the same table for uploaded files for several applications. Some files are text, some excel, some other formats. Hence the table has been set up in a generic sense.
    However, in my procedure, I'm using
    DBMS_LOB.createtemporary and
    DBMS_LOB.converttoclob
    Is there any way you could possibly provide an example of how to read the contents of the file?

  • Read blob 's data and write them to a table

    I've managed at last to upload a blob to a table database (thanks to KUBA's)
    Now I want to retrieve the blob from the database table , read it's contents and insert them to a new table. I want to do this after the upload process finishes...
    the blob is always a txt file similar to this
    GR;Greece
    CY;Cyprus
    Because I am a bit lost any guidelines would be very helpfull
    thanks

    Hi user571628. A couple of days ago I was working on the same thing, I couldn't finish the app. 'cause I was assigned to do other web app., I used the same example as you to upload the image to the DB and someone called "gnewtonaus" came up with what appears to be an excellent idea to do it, you have to use something called PL/SQL web toolkit (I have never used it and don't know how it works)... but this is what you have to do:
    You've already solved the upload part so to download the BLOB (say an image in his example) you can use a simple PL/SQL stored procedure like the one below
    E.g to display an image (from the DB) on an HTML page you just use
    <!--
    <img src="http://your_base_url:your_port/dad_name/package.display_photo?i_person_id=1234">
    -->
    -- Display a photo from the database
    procedure display_photo(i_person_id in varchar2) is
    v_blob blob;
    begin
    -- retrieve blob from database
    select image into v_blob from pho_photos where person_id = i_person_id;
    -- set http headers
    owa_util.mime_header('image/jpeg', FALSE);
    htp.p('Content-Length: ' || dbms_lob.getlength(v_blob));
    owa_util.http_header_close;
    -- initiate direct BLOB download
    wpg_docload.download_file(v_blob);
    exception
    when others then
    htp.p(to_char(sqlcode)||' - '||sqlerrm) ;
    end; -- display_photo
    Message was edited by:
    gnewtonaus
    If you get it running please post how you did it, bacause I'll have to come back and do it myself.
    Regards

  • Need help in using dbms_lob.read

    I need to upload a file into an Oracle table into a Blob column. The file name along with the file contents are all in one BLOB column.
    Once that is done I need to read from the file and extract the file contents and load it into a staging table.
    File being uploaded is a *.CSV* file.
    E.g. Of the .CSV file is: ABC.csv file and its contents will look like:
    1,Hello,Nisha
    2,Hi,Ravi
    3,Bye, Rahul
    Etc…..
    Therefore the table containing the BLOB column will contain:
    File Creation_date
    ABC.csv 09/11/2009
    How can I read a file from the BLOB column and upload into a staging table?
    Final Staging table should look like:
    Record Number Greet Name
    1 Hello Nisha
    2 Hi Ravi
    3 Bye Rahul
    I think I am suppose to use dbms_lob.read, but I am not really sure how to use it. If there is any script, kindly mail me the same.
    Thanks....

    Nisha,
    Check this example (test) and see if it can be any help. I have utl_file and sqlldr
    First Method -- I loaded alert.log successfully and you can imagine how big this file can be (5MB in my test case)
    create table t1clob
    ( clob_text clob);
    CREATE OR REPLACE DIRECTORY DIR AS '/path_to_csv_file/;
    DECLARE
       clob_data   CLOB;
       clob_file   BFILE;
    BEGIN
       INSERT INTO t1clob
       VALUES (EMPTY_CLOB ())
       RETURNING clob_text INTO clob_data;
       clob_file   := BFILENAME ('DIR', ABC.csv');
       DBMS_LOB.fileopen (clob_file);
       DBMS_LOB.loadfromfile (clob_data,
                              clob_file,
                              DBMS_LOB.getlength (clob_file)
       DBMS_LOB.fileclose (clob_file);
       COMMIT;
    END;Second Method: Use of Sqlldr
    Example of controlfile
    LOAD DATA
    INFILE alert.log "STR '|\n'"
    REPLACE INTO  table t1clob
       clob_text char(30000000)
    )Hope this helps.

  • Oracle 10.1.0 jdbc driver and 9i Database

    Are there any known issues with using the Oracle 10.1.0 jdbc drivers and 9i Database. I was lead to believe that the Jdbc drivers are backward compatible.
    Thanks

    Sorry for not including my error:
    Hello all,
    I am getting an error "Bigger type length than Maximum" when calling a stored procedure that returns a small result set. I am not working with BLOBs or CLOBs and cannot find anything on the web that addresses my specific situation.
    I would greatly appreciate any help available in solving this problem.
    Here is my data access object:
    package my.app.access;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import oracle.jdbc.OracleTypes;
    import oracle.jdbc.OracleTypes.*;
    import my.app.beans.Person;
    import my.app.util.Database;
    public class PersonAccess {
         public Person getPerson(Person person) throws SQLException, Exception {
              Database db = new Database();
              Connection con = db.connect();
              ResultSet rs;
              CallableStatement cs = con
                        .prepareCall("{call SP_GET_PERSON_BY_USER_ID (?,?)}");
              cs.setString(1, person.getUserId());
              cs.registerOutParameter(2, oracle.jdbc.OracleTypes.CURSOR);
              cs.execute(); // ################### ERROR HAPPENS ON THIS LINE
              rs = (ResultSet) cs.getObject(2);
              if (rs.next() == true) {
                   person.setId(new Integer(rs.getString("id")).intValue());
                   person.setFirstName((String) rs.getString("first_name"));
                   person.setLastname((String) rs.getString("last_name"));
                   person.setPhoneNumber((String) rs.getString("phone_number"));
                   person.setEmailAddress((String) rs.getString("email_addr"));
                   person.setRoleId(new Integer(rs.getInt("role_id")).intValue());
                   //this.roleName = rs.getString("role_name");
                   person.setPassword((String) rs.getString("password"));
                   person.setAgencyId(new Integer(rs.getInt("agency_id")).intValue());
                   if (rs.getString("account_disabled").equals("1"))
                        person.setAccountDisabled(true);
                   if (rs.getString("pwd_change_reqd").equals("0"))
                        person.setPasswordChangeRequired(false);
              return person;
    And here is a test object:
    package my.app.access;
    import my.app.beans.*;
    public class testAccess {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              PersonAccess pa = new PersonAccess();
              Person person = new Person();
              person.setUserId("jrlaughlin");
              try {
                   pa.getPerson(person);
              } catch (Exception e) {
                   e.printStackTrace();
              System.out.println("done");
    And here is the output from this test app
    java.sql.SQLException: Bigger type length than Maximum
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
         at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:884)
         at oracle.jdbc.driver.T4CMAREngine.buffer2Value(T4CMAREngine.java:2230)
         at oracle.jdbc.driver.T4CMAREngine.unmarshalUB4(T4CMAREngine.java:1146)
         at oracle.jdbc.driver.T4CTTIoac.unmarshal(T4CTTIoac.java:215)
         at oracle.jdbc.driver.T4C8TTIuds.unmarshal(T4C8TTIuds.java:121)
    done
         at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:125)
         at oracle.jdbc.driver.T4CTTIdcb.receiveFromRefCursor(T4CTTIdcb.java:103)
         at oracle.jdbc.driver.T4CResultSetAccessor.unmarshalOneRow(T4CResultSetAccessor.java:165)
         at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:787)
         at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:704)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:526)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:179)
         at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:782)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2887)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2978)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4102)
         at my.app.access.PersonAccess.getPerson(PersonAccess.java:68)
         at my.app.access.testAccess.main(testAccess.java:17)
    I am only having this problem when using the 10g jdbc driver, 9.2.0.4 and up are fine.
    Thanks again.....

  • Problem with BLOB data type and acute characters

    Hi all, I have an issue related with BLOBS cols:
    I have table A with a BLOB column and I need to insert that data into another table B, the thing is I use dbms_lob.read() that returns data into a RAW variable and then I convert it to a varchar2(with utl_raw.cast_to_varchar2) and it works ok if I have no "acute characters" on it, e.g Québec.
    If I have acute characters, the "é" is inserted wrongly with an "¿" character on the table B. I tested the BLOB on the table A to check the data and the BLOB is showing correctly the "é" character, it seems that the dbms_lob.read() funct cannot handle accute characters and replace them with "¿".
    How can I replace acute characters when I use the dbms_lob.read functionality?
    Thank you!

    what's the OS of the db server? is this code an anonymous pl/sql block, or stored pl/sql? does it run on the server or a client? if it's on the client, what's the o/s of the client?
    you might want to look at the following, plus the first 3 notes in it's reference section
    https://metalink.oracle.com/metalink/plsql/f?p=130:14:3038746456038321058::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,264157.1,1,1,1,helvetica

  • Cannot connect using oracle jdbc oci8 driver

    I am using Oracle 8.1.5 JDBC oci8 driver, but when try to connect, always got ERROR: java.lang.UnsatisfiedLinkError:make_c_state
    With the same code, but change to connect with thin driver, it works fine. Pls tell me the problem. Thank you.

    Hi,
    Here is the snippet code from oracle,
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    // We import java.io to be able to read from the command line
    import java.io.*;
    class JdbcCheckup
    public static void main (String args [])
    throws SQLException, IOException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Prompt the user for connect information
    System.out.println ("Please enter information to test connection to the database");
    String user;
    String password;
    String database;
    user = readEntry ("user: ");
    int slash_index = user.indexOf ('/');
    if (slash_index != -1)
    password = user.substring (slash_index + 1);
    user = user.substring (0, slash_index);
    else
    password = readEntry ("password: ");
    database = readEntry ("database (a TNSNAME entry): ");
    System.out.print ("Connecting to the database...");
    System.out.flush ();
    System.out.println ("Connecting...");
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:oci8:@" + database,
    user, password);
    System.out.println ("connected.");
    // Create a statement
    Statement stmt = conn.createStatement ();
    // Do the SQL "Hello World" thing
    ResultSet rset = stmt.executeQuery ("select 'Hello World' from dual");
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println ("Your JDBC installation is correct.");
    // close the resultSet
    rset.close();
    // Close the statement
    stmt.close();
    // Close the connection
    conn.close();
    // Utility function to read a line from standard input
    static String readEntry (String prompt)
    try
    StringBuffer buffer = new StringBuffer ();
    System.out.print (prompt);
    System.out.flush ();
    int c = System.in.read ();
    while (c != '\n' && c != -1)
    buffer.append ((char)c);
    c = System.in.read ();
    return buffer.toString ().trim ();
    catch (IOException e)
    return "";
    This code can be run without specifying a TNSNAME connection string, as the oci8 jdbc driver will take localhost as default.
    OR
    Only specifying the TNSNAME is enough, i.e. edit %ORACLE_HOME%\network\ADMIN\TNSNAMES.ORA file and locate the XXXXX.WORLD entry in the file. This is the TNSNAME entry referred to.
    Without TNSNAME entry you can re-run,
    %ORACLE_HOME%\jdbc\demo\samples\oci8\basic-samples> java JdbcCheckup
    Please enter information to test connection to the database
    user: system
    password: manager
    database (a TNSNAME entry):
    Connecting to the database...Connecting...
    connected.
    Hello World
    Your JDBC installation is correct.
    Hope that helps.
    Best Luck!
    Senthil Babu J

  • Convert image item to blob in memory and pass to procedure - How to?

    Hi,
    I have a form the retrieves an image from the client file system in forms 6i and displays it. Now, I need to pass the image to a stored procedure as a blob. Is there a way to convert an image item to a blob in memory to pass to my procedure?
    Thanks for the help,
    Lee

    I am working on a solution that consists to send an image from a BLOB column to a Java Bean through Forms via the Set_Custom_Property().
    Unfortunately, I encounter a strange problem. 5 characters are bad interpreted, so the final image is totaly ugly.
    I get the chunk of image like this:
    FUNCTION Get_Chunk RETURN VARCHAR2
      IS
        LN$amt  NUMBER := GN$Chunk ;
        LR$raw  RAW(32000);
      BEGIN
        LN$amt := GN$Chunk ;
        -- Read the BLOB
        dbms_lob.READ(GL$Blob, LN$amt, GN$Pos, LR$raw);
        GN$Pos := GN$Pos + LN$amt;
        LN$amt := GN$Chunk;
        RETURN utl_raw.cast_to_varchar2(LR$raw) ;
      EXCEPTION
        WHEN OTHERS THEN
            RETURN NULL ;
      END Get_Chunk ;The chunks are sent to the bean that rebuild the binary image with the getBytes() methods.
    For an unknown reason, 5 characters are misunterpreted:
    129
    141
    143
    144
    157
    Francois

  • JDBC Drviers and Linux

    What driver should I use for O8.1.6 using RedHat 6.2 Linux
    Thanks
    P.S. Please respond to [email protected]

    the jdbc driver readme file:
    Oracle JDBC Drivers release 8.1.7 README
    ========================================
    What Is New In This Release?
    These are the major new features/enhancements in this release:
    - Statement Caching
    * Implicit Statement Caching
    * Explicit Statement Caching
    - Full XA Support
    * Including XA Recover and Forget
    * OracleXid independent implementation for 8.1.7 servers and above
    - Connection Caching
    * New Scheme (FIXED_WAIT_SCHEME)
    * Statement Caching coupling
    - PLSQL Tables Support for Scalar types (for OCI driver only)
    - User-Defined Datatypes Performance Enhancement
    - Object Types Extensions
    * Serializable Type Descriptors
    * Accessing collection elements in Java primitive types
    * Buffering and indexing collection elements
    * Creating empty Lobs
    - Support for 56-bit encryption algorithms for connection using
    the Thin JDBC driver.
    These are the major bug fixes:
    - BUG-903011
    The JDBC Thin driver could not be used with usernames that
    contained Latin-1 characters when the server used UTF8 character
    set. This problem has been fixed in release 8.1.7.
    - BUG-1052489
    There was a problem with PreparedStatements being executed
    multiple times and the length of one of the bind variables (bound
    with setBinaryStream or setCharacterStream) increased. This
    problem has been fixed in release 8.1.7.
    - BUG-1069768
    There was a problem with insertion of ADTs with an image bigger
    than 4K with the JDBC Thin driver. This problem has been fixed
    in release 8.1.7.
    - BUG-1247015
    When using ResultSet::getObject() to access CHAR or VARCHAR columns
    in scrollable result sets, ResultSet::getObject() returned null.
    - BUG-1349713
    getString() of scrollable result sets returns incorrect values if
    the column data contains multibyte characters.
    Driver Versions
    These are the driver versions in the 8.1.7 release:
    - JDBC OCI Driver 8.1.7
    Client-side JDBC for use on a machine where OCI 8.1.7 is installed.
    - JDBC Thin Driver 8.1.7
    100% Java client-side JDBC for use in applets and applications.
    - JDBC Thin Server-side Driver 8.1.7
    JDBC for use by Java Stored Procedures or by Java CORBA objects
    running in Oracle 8.1.7. This driver is typically used in a middle
    tier server.
    - JDBC Server-side Internal Driver 8.1.7
    Server-side JDBC for use by Java Stored procedures or by Java CORBA
    objects running in Oracle 8.1.7. This driver used to be called the
    "JDBC Kprb Driver".
    For complete documentation, please refer to "JDBC Developer's Guide
    and Reference".
    Contents Of This Release
    The [ORACLE_HOME]/jdbc/lib directory contains:
    - classes111.zip
    Classes for use with JDK 1.1.x. It contains the JDBC driver
    classes except classes necessary for NLS support in Object and
    Collection types.
    - nls_charset11.zip
    NLS classes for use with JDK 1.1.x. It contains classes necessary
    for NLS support in Object and Collection types.
    - classes111_g.zip
    Same as classes111.zip, except that classes were compiled with
    "javac -g".
    - classes12.zip
    Classes for use with JDK 1.2.x. It contains the JDBC driver
    classes except classes necessary for NLS support in Object and
    Collection types.
    - nls_charset12.zip
    NLS classes for use with JDK 1.2.x. It contains classes necessary
    for NLS support in Object and Collection types.
    - classes12_g.zip
    Same as classes12.zip, except that classes were compiled with
    "javac -g".
    Note that the packaging of the JDBC classes to support NLS was
    changed in 8i. The classes pertaining to specific character sets
    support in Object and Collection types have been separated from the
    basic zip files. These NLS classes are now packaged into the
    extension zip files. This allows the user to include the NLS
    classes only if necessary. Please refer to the "NLS Extension Zip
    Files (for client-side only)" for further details.
    [ORACLE_HOME]/lib directory contains libocijdbc8.so and
    libocijdbc8_g.so (on Solaris), which are the shared libraries used by
    the JDBC OCI driver.
    [ORACLE_HOME]/jdbc/doc/javadoc.tar contains the JDBC Javadoc. This
    release contains a beta release of the Javadoc files for the public
    API of the public classes of Oracle JDBC.
    [ORACLE_HOME]/jdbc/demo/demo.tar contains sample JDBC programs.
    Demo programs written for JDK 1.1 must be modified to run in JDK 1.2.
    Please refer to the "Support For JDK 1.2" for porting details.
    NLS Extension Zip Files (for client-side only)
    The JDBC Server-side Internal Driver provides complete NLS support.
    It does not require any NLS extension zip files, nls_charset*.zip.
    Discussions in this section do not apply to the JDBC Server-side
    Internal Driver. You can skip this section if you only use the
    Server-side Internal Driver.
    The basic zip files, classes111.zip and classes12.zip, contain all the
    necessary classes to provide complete NLS support for:
    - Oracle Character sets for CHAR/VARCHAR/LONGVARCHAR/CLOB type data
    that is not retrieved or inserted as a data member of an Oracle 8
    Object or Collection type.
    - NLS support for CHAR/VARCHAR data members of Objects and
    Collections for a few commonly used character sets. These
    character sets are: US7ASCII, WE8DEC, WE8ISO8859P1 and UTF8.
    Users must include the appropriate extension zip in their CLASSPATH
    if utilization of other character sets in CHAR/VARCHAR data members
    of Objects/Collections is desired. It is important to note that
    extension zip files are large in size due to the requirement of
    supporting a large number of character sets. Users may choose to
    include only the necessary classes from the extension zip file.
    To do so, users can first unzip the extension zip file, and then put
    only the necessary classes in the CLASSPATH. The character set
    extension class files are named in the following format:
    CharacterConverter<OracleCharacterSetId>.class
    where <OracleCharacterSetId> is the hexidecimal representation of the
    Oracle character set id of the corresponding character set.
    Installation
    Please do not try to put multiple versions of the Oracle JDBC drivers
    in your CLASSPATH. The Oracle installer installs the JDBC Drivers in
    the [ORACLE_HOME]/jdbc directory.
    Setting Up Your Environment
    On Win95/Win98/NT:
    - Add [ORACLE_HOME]\jdbc\lib\classes111.zip and
    [ORACLE_HOME]\jdbc\lib\nls_charset11.zip to your CLASSPATH.
    (Add classes12.zip and nls_charset12.zip if JDK 1.2.x is used.)
    - Add [ORACLE_HOME]\jdbc\lib to your PATH.
    On Solaris/Digital Unix:
    - Add [ORACLE_HOME]/jdbc/lib/classes111.zip and
    [ORACLE_HOME]/jdbc/lib/nls_charset11.zip to your CLASSPATH.
    (Add classes12.zip and nls_charset12.zip if JDK 1.2.x is used.)
    - Add [ORACLE_HOME]/jdbc/lib to your LD_LIBRARY_PATH.
    On HP/UX:
    - Add [ORACLE_HOME]/jdbc/lib/classes111.zip and
    [ORACLE_HOME]/jdbc/lib/nls_charset11.zip to your CLASSPATH.
    (Add classes12.zip and nls_charset12.zip if JDK 1.2.x is used.)
    - Add [ORACLE_HOME]/jdbc/lib to your SHLIB_PATH and LD_LIBRARY_PATH.
    On AIX:
    - Add [ORACLE_HOME]/jdbc/lib/classes111.zip and
    [ORACLE_HOME]/jdbc/lib/nls_charset11.zip to your CLASSPATH.
    (Add classes12.zip and nls_charset12.zip if JDK 1.2.x is used.)
    - Add [ORACLE_HOME]/jdbc/lib to your LIBPATH and LD_LIBRARY_PATH.
    Some Useful Hints In Using the JDBC Drivers
    Please refer to "JDBC Developer's Guide and Reference" for details
    regarding usage of Oracle's JDBC Drivers. This section only offers
    useful hints. These hints are not meant to be exhaustive.
    These are a few simple things that you should do in your JDBC program:
    1. Import the necessary JDBC classes in your programs that use JDBC.
    For example:
    import java.sql.*;
    import java.math.*;
    2. Register the Oracle driver before before calling other JDBC APIs.
    (This is not needed if you are using the JDBC Server-side Internal
    Driver because registration is done automatically in the server.)
    To register the Oracle driver, make sure the following statement
    is executed at least once in your Java session:
    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());
    3. Open a connection to the database with the getConnection call.
    Different connection URLs should be used for different JDBC
    drivers. The following examples demonstrate the different URLs.
    For the JDBC OCI8 Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:oci8:@<database>",
    "scott", "tiger");
    where <database> is either an entry in tnsnames.ora or a SQL*net
    name-value pair.
    For the JDBC Thin Driver, or Server-side Thin Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@<database>",
    "scott", "tiger");
    where <database> is either a string of the form
    <host>:<port>:<sid> or a SQL*net name-value pair.
    For the JDBC Server-side Internal Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:kprb:");
    Note that the trailing ':' character is necessary. When you use
    the Server-side Internal Driver, you always connect to the
    database you are executing in. You can also do this:
    Connection conn
    = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    Java Stored Procedures
    Please note that examples for callins and instance methods using Oracle
    8 Object Types are provided in:
    [ORACLE_HOME]/javavm/demo/demo.zip
    Once unzipped, the directory containing the examples is:
    [ORACLE_HOME]/javavm/demo/examples/jsp
    Known Problems/Limitations In This Release
    The following is a list of known problems/limitations:
    1. There is a limitation regarding the use of stream input for LOB
    types. Stream input for LOB types can only be used for 8.1.7
    JDBC OCI driver connecting to an 8.1.7 Oracle server. The use of
    stream input for LOB types in all other configurations may result
    in data corruption. PreparedStatement stream input APIs include:
    setBinaryStream(), setAsciiStream(), setUnicodeStream(),
    setCharacterStream() and setObject().
    2. BUG-1018797
    Extra characters may be appended to the end of a CLOB value
    mistakenly under the following conditions:
    - setCharacterStream() is used to insert a CLOB value, and
    - The Oracle server uses multi-byte character set.
    (See 1 for limitation of stream input for LOB type.)
    3. Programs can fail to open 16 or more connections using our
    client-side drivers at any one time. This is not a limitation
    caused by the JDBC drivers. It is most likely that the limit of
    per-process file descriptors is exceeded. The solution is to
    increase the limit.
    4. The Server-side Internal Driver has the following limitation:
    - Data access for LONG and LONG RAW types is limited to 32K of
    data.
    - Inserts of Object Types (Oracle 8 Objects, Collections and
    References) will not work when the database compatibility mode
    is set to 8.0. This limitation does not apply when the
    compatibility mode is set to 8.1.
    - Statement.cancel() is not implemented.
    - In a chain of SQLExceptions, only the first one in the chain
    will have a getSQLState value.
    5. The JDBC OCI driver on an SSL connection hangs when the Java
    Virtual Machine is running in green threads mode. A work-around
    is to run the Java Virtual Machine in native threads mode.
    6. Date-time format, currency symbol and decimal symbols are always
    presented in American convention.
    7. When using OracleStatement.defineColumnType(), it is not necessary
    to define the column type to be the same as the column type
    declared in the database. If the types are different, the
    retrieved values are converted to the type specified in
    defineColumnType.
    Note: Most reasonable conversions work, but not all. If you find
    a conversion that you think is reasonable, but that does not wo rk,
    please submit a TAR to Oracle Support.
    8. The utility dbms_java.set_output or dbms_java.set_stream that is
    used for redirecting the System.out.println() in JSPs to stdout
    SHOULD NOT be used when JDBC tracing is turned on. This is
    because the current implementation of dbms_java.set_output and
    set_stream uses JDBC to write the output to stdout. The result
    would be an infinite loop.
    9. The JDBC OCI and Thin drivers do not read CHAR data via binary
    streams correctly. In other word, using getBinaryStream() to
    retrieve CHAR data may yield incorrect results. A work-around is
    to use either getCHAR() or getAsciiStream() instead. The other
    alternative is to use getUnicodeStream() although the method is
    deprecated.
    10. BUG-899078 (since 8.1.6 SDK):
    The JDBC Server-side Internal driver has extra space padding with
    PL/SQL CHAR OUT (2 to 3 space depending on character set).
    Problem occurs in most of the multibyte database character set
    except UTF8.
    11. There is a limitation for Triggers implemented in Java and Object
    Types. It only affects the IN argument types of triggers
    implemented using Java on the client-side. The restriction does
    not apply to JDBC programs running inside the server. Triggers
    implemented as Java methods cannot have IN arguments of Oracle 8
    Object or Collection type. This means the Java methods used to
    implement triggers cannot have arguments of the following types:
    - java.sql.Struct
    - java.sql.Array
    - oracle.sql.STRUCT
    - oracle.sql.ARRAY
    - oracle.jdbc2.Struct
    - oracle.jdbc2.Array
    - any class implementing oracle.jdbc2.SQLData or
    oracle.sql.CustomDatum
    12. The scrollable result set implementation has the following
    limitation:
    - setFetchDirection() on ScrollableResultSet is not supported.
    - refreshRow() on ScrollableResultSet does not support all
    combinations of sensitivity and concurrency. The following
    table depicts the supported combinations.
    Support Type Concurrency
    no TYPE_FORWARD_ONLY CONCUR_READ_ONLY
    no TYPE_FORWARD_ONLY CONCUR_UPDATABLE
    no TYPE_SCROLL_INSENSITIVE CONCUR_READ_ONLY
    yes TYPE_SCROLL_INSENSITIVE CONCUR_UPDATABLE
    yes TYPE_SCROLL_SENSITIVE CONCUR_READ_ONLY
    yes TYPE_SCROLL_SENSITIVE CONCUR_UPDATABLE
    13. BUG-1324918
    Repeatedly updating a clob with jdbc-oci, prepared statement,
    and setCharacterStream consumes the temporary tablespace. If
    you repeatedly update the clob, either the temp tablespace will
    continue to grow, or you may get a Exception in thread "main"
    java.sql.SQLException: ORA-01652: unable to extend segment if
    you have a limit on the tablespace size. The work-around is to
    use oracle.sql.CLOB::setCharacterOutputStream() instead.

  • 10g, Windows, UNC and DBMS_LOB

    G'day all,
    Scenario:
    Node A = Oracle 10g (Personal) / Windows 2003
    Nodes B,C,D = 3 x Windows 2003 machine
    From an architecture perspective and to minimize unnecessary file copies (its unfeasible to initially place the files directly into Node A's filesystem) so currently I have need of PL/SQL data access to B's, C's, D's shared files.
    A quick search through AskTom and I
    i) made a service account called "Oracle" on all machines with same password (There is no domain, they are development machines in a local workgroup)
    ii) Changed the owner of the OracleService[s] on Node A to "Oracle".
    iii) Created public shares from Nodes B, C and D and populated them with files
    iv) Logged in interactively as "Oracle" on Node A and confirmed that BOTH \\<SERVER>\SHARE (Universal Naming Convention) and mapped drive letters ( X:, Y: and Z: ) both worked for read-write access to shared files.
    [Asktom's example mentioned domain accounts but I have confirmed account access without password across the workgroup]
    And here I struck FRUSTRATION....
    From PL/SQL through granted oracle directories....
    No use of mapped drive labels works at all... even when services are started manually from logged in "Oracle" user. DBMS_LOB.GETLENGTH and FILEEXISTS fail miserably contending that Z:<anything> or Z:\<anything> doesn't exist. Not actually a surprise - Microsoft says mapped drives don't reliably work for services due to mappings being saved under a user's context.
    However, use of UNC labels work partially
    DBMS_LOB.GETLENGTH and FILEEXISTS both work... (huh?)
    but OPEN or FILEOPEN both fail with ORA-22288.
    [So in PL/SQL land, the file is valid, the file exists, the file has length, but you can't read it.....].
    Looked on Metalink to find a note stating that since 9.2 Oracle has restricted UNC paths with DBMS_LOB, citing a mysterious unreferenced security hole. [A sys/system account has to create and grant access to directory objects and BFILEs are read only but anyway....moving on...]
    Unfortunately Microsoft says that UNC is the ONLY method a service (which oracle runs as) may use to gain access to network shared files for the reasons stated above, mapped drives are not (necessarily) global.
    Elsewhere on Metalink / OTN I have seen references to Oracle supporting different methods (even different syntaxes) of using UNC paths for different purposes... (archive logs, control files etc).
    Further weirdnesses....UTL_FILE seems to work correctly and Java source with appropriate privileges can definitely see the files (via the UNC paths) - so why the asymmetry between UTL_FILE, Java and BFILEs?
    [Not very "grid" like is it? Seemingly an arbitrarily restriction on the use of an existent OPERATING SYSTEM virtualisation method].
    Ok, how about a solution - Is there an event that I can use to suppress the new security checking? (Assuming that is the cause of this issue).
    In the meantime, I will be coding up a PL/SQL UTL_FILE.GET_RAW or Java to temp BLOB loader but I was curious to see if anyone else had
    i) A solution for the problem.
    ii) An explanation for the situation.
    Thanks muchly,
    Lachlan

    I've written rough replacements for dbms_lob.fragment_delete and dbms_lob.fragment_insert. Be glad for any advise.
    procedure clob_fragment_delete(l_clob in out clob, l_amount in integer, l_offset in integer)
    is
      l_len integer := dbms_lob.getlength(l_clob);
    begin
      dbms_lob.copy(l_clob, l_clob, l_len - l_offset - l_amount, l_offset, l_offset + l_amount);
      dbms_lob.trim(l_clob, l_len - l_amount);
    end;
    procedure clob_fragment_insert(l_clob in out clob, l_amount in integer, l_offset in integer,
                                   l_buffer in varchar2 character set l_clob%charset)
    is
      l_len integer := dbms_lob.getlength(l_clob);
    begin
      dbms_lob.copy(l_clob, l_clob, l_len - l_offset, l_offset + l_amount, l_offset);
      dbms_lob.write(l_clob, l_amount, l_offset, l_buffer);
    end;

  • Oci8 and oracle thin

    I am using developer 3.0 on the NT server machine, with oracle 8
    First of all when i start my computer one error message raise that is "one of your service is not running please check the event log". I saw the event log that service is oraclestartorc1. who can i start this service. the other oraclelistener service is also give error message in starting.
    so next thing is when i click on the connection UI to make a new connection. I click on the oracle oci8 and use localhost = 127.0.0.1 and protocol = TCP and SID = orcl then error message comes that "ocijdbc8 is not in share path" who can i remove this problem also. I also use BEQ protocol to connect but the error message is same. When i use oracle thin driver then it raise message "could not establish the connection with adapter". Who can i remove this also. when i use the jdbc-odbc bridge it success the connection in test. But it does not show in connection. Who can i get driver for oci8, oci7 or for thin. Simply i want to connect my computer local database. my oracle directory is "orant" please help me thanks..
    null

    Jawada,
    Try the following:
    1. Make sure your ORACLE_HOME directory is in your PATH (JDeveloper needs this so it can find the OCI driver's client-side DLL).
    2. Make sure you have an alias set up for your database in your TNSNAMES.ORA file (usually located in ORACLE_HOME\network\admin). I believe previous posts to your other questions provided instructions for this.
    3. Within JDeveloper, select Tools | IDE Options... from the menu. Choose the Environment Tab, and in the Oracle Home section, choose the name of your Oracle Home or choose Default Home from the Select an Oracle Home list. (this isn't really required unless you have multiple Oracle Home's installed on your machine).
    4. When creating your connection within JDeveloper:
    a. Choose Oracle JDBC OCI-8 from the Select a JDBC Driver list.
    b. Choose Existing TNS Names from the Select a Connection Method list.
    c. Choose the alias for your database from the TNS Service list (this list will not appear until you choose Existing TNS Names from the Connection Method list.
    null

  • Error while executing JDBC receiver and sender CC

    Hi,
    Iam trying to RFC to JDBC scenario.
    when i do e2e testing iam facing error as "Configuration error: com.sap.aii.af.service.util.configuration.MandatoryParameterMissingException: Value missing for mandatory configuration attribute tableEOColumnNameId" in CC monitoring and "error reading SAP_XIAdapterFramework from SLD" in SXMB Moni.
    Also while performing JDBC to RFC  iam facing errror as
    "Error during database connection to the database URL 'jdbc:sqlserver://20.198.16.115\SQLSERVER2005:14330;databaseName=SAPHRDataStore' using the JDBC driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:sqlserver://20.198.16.115\SQLSERVER2005:14330;databaseName=SAPHRDataStore': SAPClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver'"
    Please help me in this regard.
    Regards
    Madhu

    It should be com.microsoft.jdbc.sqlserver.SQLServerDriver
    I think you have it as com.microsoft.sqlserver.jdbc.SQLServerDriver
    Thanks
    Praveen M

  • DBMS_LOB.READ + ORA-06502

    Hello,
    I have the following function to convert a CLOB to a BLOB.
    function Clob_2_Blob (I_CLOB IN CLOB)
    return blob
    is
    v_rst BLOB := empty_blob();
    v_clob_length BINARY_INTEGER;
    v_blob BLOB := empty_blob();
    -- Param pour lire le CLOB.
    v_buffer VARCHAR2(32767);
    v_amount BINARY_INTEGER := 32767;
    v_position INTEGER := 1;
    BEGIN
    dbms_lob.createtemporary(v_rst,TRUE);
    v_clob_length := DBMS_LOB.GETLENGTH(I_CLOB);
    LOOP
    EXIT WHEN v_position > v_clob_length;
    dbms_lob.READ (I_CLOB, v_amount, v_position, v_buffer);
    v_blob := utl_raw.cast_to_raw(v_buffer);
    dbms_lob.append(v_rst,v_blob);
    v_position := v_position + v_amount;
    END LOOP;
    return v_rst;
    end Clob_2_Blob;
    When I use it, I get a ORA-06502 exception.
    If I change v_amount as follow
    v_amount BINARY_INTEGER := 32766;
    then I don't get any exception.
    I don't understand this because in theory, I can get up to 32767.
    What's wrong ?

    Hi Peter,
    It worked after i split the v_read_count to half. It means
    v_read_cnt   := 16383;The issue is when reading a character from the database it can get 'expanded' into two bytes. The chunk buffer can hold 32767 characters so if you read 16383 multi-byte characters from the database, it takes up twice the room (the 32766, one left over from rounding).
    Thanks

Maybe you are looking for

  • Simple Solution for authentication with WD and R/3 Backend

    Hi, we are developing a Web-Dynpro based Application running on a J2EE/ABAP Stack machine. Our backend is a 4.6C SAP System, we are using adaptive RFCs to get/put data there. The user of the WD App should authenticate against the J2EE/ABAP engine, an

  • Print in Character Mode on Dot Matrix Printer

    Dear All, When we print any reports from SAP to Dox Matrix printers it comes in graphic mode. So it will take too much time to print and  print is also not readable. Same I want to print in Character mode (Simole reports where graphics are not involv

  • PO without Costing

    Hi experts, recently i have this problem, We have  2 new members, one reponsible in production order and another responsible in  production line. First member create production order without costing, release , save and then send p/o to  production. S

  • Source system with human icon

    Hi Friends, I know this question is silly but here i am, new to BW and trying to learn something each day. In the source systems what is the source system with the human icon on it? If you can provide me links to documentation on that it would be gre

  • Nested error in email

    Hi I am trying to send multiple email to multiple IDs using OdiSendEmail. I am able to send for 1 ID. If I give [email protected],[email protected] I get nested exception error. Is it not possible to send emails to multiple IDs from ODI.. -app