JDBC Problem: "select * from NAMES for update of FIRSTNAME"

I am using Oracle 8 and JDBC thin driver. Is there any reason
why when I try to use the statement:
"select * from NAMES for update of FIRSTNAME"
it does NOT work in JDBC?
However when I do the statement in SQL-Plus it works fine.
If anyone has used this statement with success, please let me
know that it actually works, so that I know there is something
wrong with me!
Any code snippets would be very helpful.
Could it be the thin driver?
Please help! Thanks in advance.
null

Thomas Gutzmann (guest) wrote:
: James,
: for this command you need transactional control, which is not
: possible with JDBC - if I'm not wrong. You can circumvent it
with
: something like:
: select x into vOld from t where id=4711;
: vNew := 0.815;
: update t set x = vNew where id = 4711 and x = vOld;
: Another option would be to write a stored PL/SQL procedure that
: runs the whole transaction.
: Cheers
: Thomas
: James Ward (guest) wrote:
: : I am using Oracle 8 and JDBC thin driver. Is there any
reason
: : why when I try to use the statement:
: : "select * from NAMES for update of FIRSTNAME"
: : it does NOT work in JDBC?
: : However when I do the statement in SQL-Plus it works fine.
: : If anyone has used this statement with success, please let me
: : know that it actually works, so that I know there is
something
: : wrong with me!
: : Any code snippets would be very helpful.
: : Could it be the thin driver?
: : Please help! Thanks in advance.
I don't think this is correct. I have used select for update
with no problems. you can send a "set transaction control"
via sql, I believe, but you shouldn't need to do so...
Maureen
null

Similar Messages

  • Jdbc mysql "select ... for update" and isolation level...

    Dear, I am now writing an application, in which some worker threads will get a waiting job from database (mysql) and perform the processing.
    To avoid workers getting the same job id, I have studied the topics about locks, isolation level, and something like "select ... for update".
    The storage engine being used is innoDB. Actually the problem seems solved after using "select ... for update" to get the id, but I am just curious that do I also need to care about the isolation level. It is because when I do some experiments by setting the isolation level to serializable, but NOT using "SELECT ... FOR UPDATE" (just simple select), exception something like "deadlock found and try to restart transaction" occurs. Is there any relationship between these two things? Any comments are welcome!! Thanks!!!

    ashipj wrote:
    can u plz provide me with the code (connection string). Am new to Mysql.
    And also the driver u are using.
    Thank youDon't hijack other's topics. Kindly start your own. Don't do that before you read the [Sun JDBC tutorial|http://java.sun.com/docs/books/tutorial/jdbc/index.html] and the [MySQL JDBC documentation|http://dev.mysql.com/doc/refman/5.0/en/connector-j.html].

  • The lock for "select ... for update"

    1. select * from tbl for update;
    2. SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username, b.os_user_name FROM v$process p, v$session a, v$locked_object b, all_objects c WHERE p.addr = a.paddr AND a.process = b.process AND c.object_id = b.object_id
    Why there is two records with the same session_id:
    1 14728 11961 TBL 290 STAR bil
    2 14732 50904 TBL 290 STAR bil
    The SQL "select ... for update" will generate two locks?

    I get one lock:
    SQL> SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username, b.os_user_name FROM v
    $process p, v$session a, v$locked_object b, all_objects c WHERE p.addr = a.paddr AND a.process = b.p
    rocess AND c.object_id = b.object_id;
    no rows selected
    SQL> select * from emp for update;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-12-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-02-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-02-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-04-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-09-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-05-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-06-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 09-12-1982 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-11-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-09-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 12-01-1983 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-12-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-12-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-01-1982 00:00:00       1300                    10
    14 rows selected.
    SQL> SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username, b.os_user_name FROM v
    $process p, v$session a, v$locked_object b, all_objects c WHERE p.addr = a.paddr AND a.process = b.p
    rocess AND c.object_id = b.object_id;
    SPID            SERIAL# OBJECT_NAME                    SESSION_ID ORACLE_USERNAME                OS_USER_NAME
    2536                  4 EMP                                    25 HOEK                           hoek
    1 row selected.What database version are you using?
    (the result of: select * from v$version; )

  • Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination

    Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination
    Problem in committing transactions in Multiple Forms (Oracle Forms) with POST built-in command:
    Consider that the following statements are written in WHEN-WINDOW-CLOSED trigger of a called form.
    Statements in called form (Form name: FORM_CHILD):
    go_block('display_block') ;
    do_key('execute_query') ;
    -- Data from table_b will be populated in this block, based on the value of COLUMN_1 obtained
    -- from TABLE_A.
    -- Example: If the value of COLUMN_1 is 10, then all the matching records from TABLE_B, which
    -- are inserted with value 10 in TABLE_B.COLUMN_1 will be fetched and shown here.
    if user_choice = 'YES' then
    commit ;
    else
    rollback ;
    end if ;
    Statements in calling forms:
    There are two calling forms having following statements and it is going to call the above said called form.
    CALLING FORM 1
    Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...; Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    CALLING FORM 2:
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...;
    insert into table_b ...;
    Our understanding:
    Assume that both the forms are running from two different machines/instances, issuing commit at the same time. In this case, forms will start executing the statements written in ON-INSERT trigger, the moment POST command is executed. Though the commit is issued at the same time, according to oracle, only one of the request will be taken for processing first. Assume that calling form 1 is getting processed first.
    So, it fetches the value available in COLUMN_1 of TABLE_A and locks the row from further select, update, etc. as SELECT...FOR UPDATE command is used (note that NOWAIT is not given, hence the lock will be released only when COMMIT or ROLLBACK happens) and proceed executing further INSERT statements. Because of the lock provided by the SELECT...FOR UPDATE command, the statements in calling form 2 will wait for the resource.
    After executing the INSERT statements, the FORM_CHILD is called. The rows inserted in to TABLE_A will be queried and shown. The database changes will be committed when user closes the window (as COMMIT is issued in its WHEN-WINDOW-CLOSED trigger). Then the SELECT...FOR UPDATE lock will be released and calling form 2's statements will be executed.
    Actual happenings or Mis-behavior:
    Calling form 2 starts executing INSERT statements instead of waiting for SELECT...FOR UPDATE lock. Also, the value selected from TABLE_A.COLUMN_1 is same in both the calling forms, which is wrong.
    The rows inserted into TABLE_B are having similar COLUMN_1 values in calling form 2 and they are fetched and shown in the called form FORM_CHILD.
    Note that in calling form 2 also POST only is issued, but the changes posted there are accessible in calling form 1 also, which is wrong.
    Kindly suggest us as to how to fix above problem. It will be much use, if you can send us the information regarding the behavior of Oracle Forms POST built-in also.
    Our mail ID: [email protected]
    Thanks a lot in advance.

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

  • Select...for update and close()

    I am seeing unexpected behaviour when working with select for update, and I hope to get some clarification about it. I have RTFM and checked out any online information I could find, but didn't see too much about row level locks. See below for the problem I am encountering
    We have an application with lots of threads on multiple nodes that uses a combination of row level locking and status flags to mark a row as being processed.
    We are locking the rows, and then after completing the select ... for update statement we are closing the JDBC statement.
    On executing the statement.close() it appears as though the row level lock is lost. Can anyone confirm this behaviour, or tell me that I am misreading the behaviour that I am seeing.
    Thanks in advance,
    Robert Dawson

    I'd expect this behavior regardless of whether autocommit was on. If a statement is closed, any locks held by that statement must be released. If they weren't, no other statement would have permission to remove the locks, so the rows would remain locked indefinitely.
    Justin

  • Unable to stop Flashplayer 11.5 from prompting for update

    Hi, I support about 3000 machines worldwide.  We use Windows 7 x64, with IE10.  In my base image I Installed Flashplayer ActiveX 11.5.502.146, using the full EXE installer and the switches -install -au2 (i do not want any updates done or users to get any prompts for updates).  The MMS.cfg created using these switches shows 2 lines:
    AutoUpdateDisable=1
    SilentAutoUpdateEnable=0
    and is located in the x64 path c:\windows\syswow64\macromed\flash
    In the Flash Player settings manager, the advanced tab shows the radio button selection "Never check for updates (not recommended) is selected (this is greyed out because all of our users run under standard user permissions). Installation runs fine and the product works fine in IE, the problem I have is that my users are still prompted by the Update Adobe Flashplayer message on a weekly basis.
    I looked at the admin guide for 11.5, and I believe my settings are right.  Why am I still getting this prompt?  Does mms.cfg have to be in the x86 path as well?  Is there something with standard user rights as it relates to adobe updates?  Should I install this from the MSI?
    I can't update to 11.7 right now as we are getting ready to start rolling out my image and don't want to make changes at this time.   I'm looking for any input on what I may be doing wrong that I continue to see update prompts.  Thanks in advance for any information, and I'd be happy to provide additional info if I left out something.

    See also http://forums.adobe.com/thread/1194289
    And https://bugbase.adobe.com/index.cfm?event=bug&id=3545918

  • Need BAPI Name for updation of Subcontracting scheduling line agreement

    Hi All,
            Can anybody please tell me BAPI Name for updation of Subcontracting scheduling line agreement from EKET table?
    Note: BAPI_PO_CHANGE is not useful for me.
    Thanks and Regards,
    Atul.

    Hi Muralidhara,
    Can you please give some more details for this BAPI..
    I tried using it , but getting an error "No instance of object type PurchSchedAgreement has been created. External reference:"
    and "Enter G/L Account" (Infact I did specify G/L account in account assignment table)
    with regards,
    Kirti

  • Unecessary use of SELECT...FOR UPDATE causing Deadlock

    DB version:10gR2
    We are getting a deadlock issue frequently. When i looked at the trace file i found that the <em>Rolled back SQL</em> and the <em>Successfull SQL</em> are both <strong>SELECT FOR UPDATE</strong> statements. They both are declared before UPDATE statments.
    Both of these PL/SQL codes are developed by a C++ guy. When is it appropriate to use SELECT ..FOR UPDATE. I've seen SELECT ...FOR UPDATE very rarely in the codes developed by PL/SQL gurus in our firm. Why didn't they use SELECT..FOR UPDATE to lock rows before UPDATE/DELETE/INSERT in their codes?

    For update is a rowlevel locking. like
    Session 1
    SQL> conn scott/tiger
    Connected.
    SQL> select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    SQL> select * from emp where empno = 7369 for update;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
    SQL>
    Session 2
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> update emp set sal = 1000 where empno = 7900
      2  /
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> update emp set sal = 1000 where empno = 7369
      2
    SQL> /In session 1 we have lock row where empno = 7369 & in session 2 we are updating salary where empno = 7900 it is updating successfully, but we are updating a empno = 7369 then session 2nd hangs for waiting for the next session.
    Also read the Link (http://www.oracle.com/technology/oramag/oracle/05-nov/o65asktom.html)

  • Help, question about "select ... for update nowait"

    There is a proc code. In the beginning of the code, I used a SQL "select ... for update nowait" in order to prevent from another proc executing at the same time. When the case happens, "-54, ORA-00054: resource busy and acquire with NOWAIT specified" will be printed in the screen.
    But there is a question: I need to print sth to indicate "another proc is running". I used "if (sqlca.sqlcode == -54)" as precondition, such as:
    if (sqlca.sqlcode == -54) {
    printf("There is another proc running.\n");
    However, this line will not be printed. I doubt that the code quits directly when using "select ... for update nowait" so as not to set value (-54) to sqlca.sqlcode.
    So, could you suggest whether there is another way that I can use to print "There is another proc running" when another proc is running?
    Thx a lot for your kindly reply.

    Yes, that link. Scroll down a bit and you will see:
    The calling application gets a PL/SQL exception, which it can process using the error-reporting functions SQLCODE and SQLERRM in an OTHERS handler. Also, it can use the pragma EXCEPTION_INIT to map specific error numbers returned by raise_application_error to exceptions of its own, as the following Pro*C example shows:
    EXEC SQL EXECUTE
    /* Execute embedded PL/SQL block using host
    variables v_emp_id and v_amount, which were
    assigned values in the host environment. */
    DECLARE
    null_salary EXCEPTION;
    /* Map error number returned by raise_application_error
    to user-defined exception. */
    PRAGMA EXCEPTION_INIT(null_salary, -20101);
    BEGIN
    raise_salary(:v_emp_id, :v_amount);
    EXCEPTION
    WHEN null_salary THEN
    INSERT INTO emp_audit VALUES (:v_emp_id, ...);
    END;
    END-EXEC;
    This technique allows the calling application to handle error conditions in specific exception handlers.

  • Ansi SQL for "select ... for update nowait"

    Hi, All,
    I have a sql
    select ... for update nowait
    My boss wants it to be ANSI compliant.
    I am not familiar with ANSI SQL.
    What should be the syntax in Ansi?
    Thanks a lot!

    I resent having the lowest salary :-)Sorry John, it's probably due to the exchange rate of sterling against the canuck dollar right now.
    SQL> select empno, ename, sal, job, mgr from emp;
         EMPNO ENAME             SAL JOB              MGR
          7369 SPENCER           800 CLERK           7902
          7499 VERREYNNE        1600 SALESMAN        7698
          7521 VAN WIJK         1250 SALESMAN        7698
          7566 MAINGUY          2975 MANAGER         7839
          7654 KISHORE          1250 SALESMAN        7698
          7698 BARRY            2850 MANAGER         7839
          7782 BOEHMER          2695 MANAGER         7839
          7788 PADFIELD         3000 ANALYST         7566
          7839 SCHNEIDER        5500 PRESIDENT
          7844 GASPAROTTO       1500 SALESMAN        7698
          7876 CAVE             1100 CLERK           7788
          7900 CLARKE            950 CLERK           7698
          7902 JAFFAR           3000 ANALYST         7566
          7934 ROBERTSON        1430 CLERK           7782
    14 rows selected.
    SQL> Cheers, APC

  • Standard Program Name for updating the System-Variables everyday in BACKGRO

    Hi All,
    Can anybody tell me the Standard Program Name for updating the System-Variables everyday in BACKGROUND job?

    Hello matt,
    I have a program with variant.
    This VARIANT input values will store in TVARVC table every day night background job.
    i want the program name

  • "SELECT .. FOR UPDATE" lock event

    Hi All,
    The application will send "SELECT .. FOR UPDATE" statement when end-user click one module on screen.
    Now the system have many end-user need to use this module more than before and elapsed time is 15 seconds per session if have 10 sessions click this module that mean the maximum locked time is 150 seconds (15*10) and source code cannot change.
    My question is which oracle parameter can control about lock timeout in this case or not?
    I tried to check all parameter about lock and timeout of oracle parameter that cannot to solve it but I may missing something.
    Thansks
    Hiko

    taohiko wrote:
    Hi All,
    The application will send "SELECT .. FOR UPDATE" statement when end-user click one module on screen.
    Now the system have many end-user need to use this module more than before and elapsed time is 15 seconds per session if have 10 sessions click this module that mean the maximum locked time is 150 seconds (15*10) and source code cannot change.
    My question is which oracle parameter can control about lock timeout in this case or not?
    I tried to check all parameter about lock and timeout of oracle parameter that cannot to solve it but I may missing something.
    Thansks
    Hikohttp://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/static.htm#LNPLS603
    By default, the SELECT FOR UPDATE statement waits until the requested row lock is acquired. To change this behavior, use the NOWAIT, WAIT, or SKIP LOCKED clause of the SELECT FOR UPDATE statement.
    If you are adamant as you say that the application cannot be changed (almost never a truthful statement) ... then you are out of luck.

  • JPA does the right thing for select but not for update

    Hi,
    I'm struggling a bit with my first JSF application: at the moment on the persistence. I am using classes generated by Netbeans. I have a JSF page which is deployed on Sun AS.
    The select, update and new are all done from the same backing bean. Only the select works, even though they all use the same EntityManagerFactory.
    I copy the 3 methods below together with persistence.xml. May be someone can suggest why no updates;
    ......The injection code
    @Resource
    private UserTransaction utx;
    @PersistenceUnit(unitName = "PortGenPU")
    private EntityManagerFactory emf;
    private EntityManager getEntityManager() {
    return emf.createEntityManager();
    .....The selection code: This works.
    public DataModel getUserProcessess() {
    EntityManager em = getEntityManager();
    try{
    Query q = em.createQuery("select object(o) from UserProcesses as o");
    q.setMaxResults(batchSize);
    q.setFirstResult(firstItem);
    model = new ListDataModel(q.getResultList());
    return model;
    } finally {
    em.close();
    ....The update code. This gives a success message but doesn't change the db
    public String edit() {
    EntityManager em = getEntityManager();
    logger.info("In Edit name = " +userProcesses.getProcessName());
    try {
    utx.begin();
    logger.info("In Edit trasnaction = " +userProcesses.getProcessName());
    userProcesses = em.merge(userProcesses);
    logger.info("In Edit after merge id = " + userProcesses.getProcessId());
    utx.commit();
    addSuccessMessage("UserProcesses was successfully updated.");
    } catch (Exception ex) {
    try {
    addErrorMessage(ex.getLocalizedMessage());
    utx.rollback();
    } catch (Exception e) {
    addErrorMessage(e.getLocalizedMessage());
    } finally {
    em.close();
    return "userProcesses_list";
    ....The insert code: This also gives a success message but fails to change the db.
    public String create() {
    EntityManager em = getEntityManager();
    logger.info("In create name = " +userProcesses.getProcessName());
    try {
    utx.begin();
    em.persist(userProcesses);
    utx.commit();
    logger.info("In create after persist id = " + userProcesses.getProcessId());
    addSuccessMessage("UserProcesses was successfully created.");
    } catch (Exception ex) {
    try {
    addErrorMessage(ex.getLocalizedMessage());
    utx.rollback();
    } catch (Exception e) {
    addErrorMessage(e.getLocalizedMessage());
    } finally {
    em.close();
    return "userProcesses_list";
    ...Now persistence.xml ("portdev" is a sjas jdbc resource)
    <persistence-unit name="PortGenPU" transaction-type="RESOURCE_LOCAL">
    <non-jta-data-source>portdev</non-jta-data-source >
    <class>anicca.portfolio.data.UserProcesses</class>
    </persistence-unit>

    this an example of how to update a record through
    jpa:
    public void alterOrderQuantity(long orderId,
    int newQuantity){
    EntityManager em =
    jpaResourceBean.getEMF().createEntityManager();
    try{
    em.getTransaction().begin();
    Order order = em.find(Order.class, orderId);
    order.setQuantity(newQuantity);
    em.getTransaction().commit();
    }finally{
    em.close();
    Hi.
    Many thanks for the help with update. I had seen an example like yours before but forgotten about it. Do you always have to have a em.find() inside the transaction? (We are talking about a user submitting jsf page to be updated.)
    And what about em.merge(). What is the purpose of this function? It is quite unclear from the javadoc.

  • ORA-01002-Error in Select ... for update

    I would like to insert CLOB in a table (VP_EVENTS) with a primary key (eventid) with the following code:
    String content = "AAAAAAAAAAAAABBBBBBBBBBXXX";
    PreparedStatement cs = this.con.prepareStatement("INSERT INTO vp_events (eventid,term,participant)
    VALUES (?,?,empty_clob())");
    //Register IN-Parameter
    cs.setInt(1, 1);
    cs.setInt(2, 1);
    cs.setTimestamp(3, new java.sql.Timestamp( System.currentTimeMillis() ));
    //Execute statement
    cs.execute();
    cs.close();
    Statement stmt = con.createStatement();
    ResultSet clobLocatorSet = stmt.executeQuery( "SELECT PARTICIPANT FROM VP_EVENTS WHERE EVENTID=1 FOR UPDATE");
    // Get the CLOB-locator
    if (clobLocatorSet.next())
    oracle.sql.CLOB clob =
    ((oracle.jdbc.driver.OracleResultSet)
    clobLocatorSet).getCLOB(1);
    // Write CLOB-Data
    // The first parameter to plsql_write, is // the offset from which to start
    // writing, and the second parameter is the // data to be written.
    // plsql_length(), returns the length of // the data in the CLOB column
    countCLOB = clob.plsql_write(
    0,content.toCharArray());
    At the execution-point of the "Select for Update"-statement the oracle thin driver throws the Error "Fetch out of sequence ORA-01002".
    What's wrong?

    Connection conn = DriverManager.getConnection ("jdbc racle:thin:@myhost:1521:ORCL","scott", "tiger");
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement ();
    null

  • I cannot execute an procedure in Java that is a "select ... for update" stt

    I have a table with a column that has BLOB types. First I insert into that table with EMPTY_BLOB(). After I create a procedure as:
    PROCEDURE file_content_select
            p_id IN NUMBER,
            p_file_content OUT BLOB
       IS
    BEGIN
        SELECT f.file_content
        INTO p_file_content
        FROM files f
        WHERE f.id = p_id
        FOR UPDATE of f.file_content;
    END; In my java program. I do that:
    my query string:
    query = ""
                        + "BEGIN FILE_CONTENT_SELECT ("
                        + id
                        + ",?); END;";and my execute query code:
    callableStatement = connection.prepareCall(query);
    callableStatement.registerOutParameter(1, OracleTypes.BLOB);
    callableStatement.execute();
    dataBlob = (BLOB) callableStatement.getObject(1);But, I seem to stop at
    callableStatement.execute();where I'm wrong? Thanks for help me.

    When you say, "locked" was already deselected, I take it that you mean the small icon at the bottom right of the Get Info window displayed an open lock picture.
    Have you tried locking it, then unlocking it again?  I expect you will be able to lock it by simply clicking on the open lock icon, but to unlock it again you will need to supply an Admin password.
    Odd that DU didn't fix it.  That would be my first thought also.  Suggest trying it again, if you haven't already done so.
    Speaking of DU, have you verified your HDD?
    My Applications folder permissions read -
    System          Read and Write
    admin           Read and Write
    everyone      Read only
    Message was edited by: El Deanio

Maybe you are looking for