Spot the deliberate mistake ! Grand prize for the first correct answer .....

Hi all,
I have been trying to get this piddly bit of code to work for a day now and I am out of cigarettes so.....
JAVA STORED PROCEDURE USING JDEVELOPER
======================================
The thing deploys ok. It is even executing from SQL*PLUS and I get a PL/SQL procedure successfully completed message. The problem is that it does not insert anything into the table. I have tried a commit after the exec in SQL*PLUS to no avail. Any suggestions ? It is the same for a DELETE statement.
I know I don't need the three variables but I am at the stage of hard-coding some values into it to get it to work.
Oh, and the prize is my UMIST cigarette lighter, a collectors item in a few hundred years, worth 10 pence at the moment.
Cheers.
package mypackage;
import java.sql.*;
import java.io.*;
public class testSelect {
public static void testSelect (int first, int second, int third)
throws Exception {
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@prams_nt_03:1521:gems", "rb199", "rb199");
String sql = "INSERT INTO test VALUES (1, 2, 3)";
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.executeUpdate();
pstmt.close();
catch(Exception m)
{ m.printStackTrace();}

Here's my guess.
The commit from sqlplus would commit changes make by the current Oracle session. However, when you use the server thin driver, you are creating another Oracle session to the prams_nt_03 db. In order to commit this correctly. I think you need to call con.commit(); after the pstmt.executeUpdate(); This will commit the change you just make in the thin created Oracle session.
In addition, it's odd that the thin connection doesn't do 'setAutoCommit to true' by default.
package mypackage;
import java.sql.*;
import java.io.*;
public class testSelect {
public static void testSelect (int first, int second, int third)
throws Exception {
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@prams_nt_03:1521:gems", "rb199", "rb199");
String sql = "INSERT INTO test VALUES (1, 2, 3)";
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.executeUpdate();
pstmt.close();
catch(Exception m)
{ m.printStackTrace();}

Similar Messages

  • Hello ! When i will Buy a Movie in iTunes, they ask me two Security Questions and i have forget the 2 correct answers. Can you help me please ??

    Hello ! When i will Buy a Movie in iTunes, they ask me two Security Questions and i have forget the 2 correct answers. Can you help me please ??

    Blue, and Mr. Frisky...

  • When receiving an call waiting can't push the hold and answer button.Because: it will put on hold the first caller, answer to the second, but you can't hear the second until you end the first call !!! Anyone has the same problem ? Did anyone know why ?

    When receiving an call waiting can't push the hold and answer button.Because: it will put on hold the first caller, answer to the second, but you can't hear the second until you end the first call !!! Anyone has the same problem ? Did anyone know why ?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How can I mark something as 'helpful'  or 'the correct answer' ?

    I have been posting a handful of questions within the DreamweaverCC forum.
    I notice that there indications that 5 people have marked the replies as 'helpful'.
    How can I mark some of the responses to my posts as helpful ?
    I am unable to do this.
    Under my 'Actions' button it says "no actions available".
    I also do not have the ability to edit my own posts.
    For instance, I have resolved one of the problems and I would like to clean up my own post eliminating the 'noise' and leaving the relevant.
    This is for the sake of others.  I have noticed that one of my posts has 200+ views.  I do not want to waste people's time.
    During the first week of may, the Adobe FORUMS had a message for a couple of days that they were doing a major overhaul of the Forum.
    Since then I am unable to sign in to the forums (or to Adobe.com) from my ipad.
    I upgraded my IOS, and cleared cookies and history.
    note.  Today I was doing a general search on my ipad (w/o) logging in.
    I wanted to see what was out there about header.php.
    I came across my own post (which requires cleanup).
    I came across another person's.  It made me laugh.
    The individuals who were helping him asked him to post his code
    which ultimately ended up in the longest scroll in the world  (hundreds of div ids).
    The responders said 'nightmare'.
    It made me laugh because I am certain that part of my posts elicit the same response (nightmare)
    I would like to clean them up.

    Thanks Hans-Günter.
    Yes, I have noticed that elsewhere. I just do not have those options.
    Okay.  After I clicked my own response to you - then the greenStar 'correct answer showed up.
    So I clicked the 'greenstar' on your response.
    Guess what ?
    Earlier, I emailed Preran because there weren't any options under my 'Actions' button for instance 'edit or 'delete'.
    They are now there !!
    Preran
    hans-g.
    thanks !!
    What is the best way to navigate to my own posts so that I can follow them ?
    The only way I can do this is by clicking on my inbox & activity under my profile icon.
    There is a list of the latest responses and emails but it is not really a list of my own posts.

  • Did they take out the free section, you know where they might offer a free episode/song/video/etc in one spot (or at least did they for Canada)? I can find the english song of the week, but that is it...

    Did they take out the free section, you know where they might offer a free episode/song/video/etc in one spot (or at least did they for Canada)? I can find the english song of the week (I used to enjoy browsing both the english and french), but that is it...

    Nevermind. For some reason it loaded wrong/poorly/? It was back after I closed itunes down and re-opened it.
    Thanks though

  • I need the grand total for particular coulumn for ALV grid report(OOPs).

    Hello,
    I have used the following code,
    But i m not getting the grand total by default.No error but not getting the desired result.
    Could you please help me in this regard.
    FORM  display_simple_alv.
      DATA :  lr_msg  TYPE   REF   TO  cx_salv_msg.
      DATA : lv_header   TYPE   REF   TO  cl_salv_form_layout_grid,
             lv_h_label  TYPE   REF   TO  cl_salv_form_label,
             lv_h_flow   TYPE   REF   TO  cl_salv_form_layout_flow.
      DATA: gr_sorts TYPE REF TO cl_salv_sorts.
      DATA: gr_agg TYPE REF TO cl_salv_aggregations.
      TRY .
          cl_salv_table=>factory(  IMPORTING  r_salv_table = gr_salv_table
                                   CHANGING  t_table = gt_invdetails4 ).
        CATCH  cx_salv_msg  INTO  lr_msg.
      ENDTRY  .
    Display Basic Toolbar
      gr_functions = gr_salv_table->get_functions( ).
      gr_functions->set_all( abap_true ).
      TRY .
          gr_columns = gr_salv_table->get_columns(  ).
          gr_columns->set_optimize( ).
        CATCH  cx_salv_not_found.
      ENDTRY .
      TRY .
          gr_column ?= gr_columns->get_column(  'KUNNR'  ).
          gr_column->set_long_text(  text-009 ).
          gr_column->set_medium_text(  text-009 ).
          gr_column->set_short_text(  text-009 ).
          gr_column ?= gr_columns->get_column(  'NAME1'  ).
          gr_column->set_long_text(  text-010 ).
          gr_column->set_medium_text(  text-010 ).
          gr_column->set_short_text(  text-011 ).
          gr_column ?= gr_columns->get_column(  'AMOUNT'  ).
          gr_column->set_long_text(  text-012 ).
          gr_column->set_medium_text(  text-012 ).
          gr_column->set_short_text(  text-012 ).
          gr_column ?= gr_columns->get_column(  'TAX'  ).
          gr_column->set_long_text(  text-013 ).
          gr_column->set_medium_text(  text-013 ).
          gr_column->set_short_text(  text-013 ).
          gr_column ?= gr_columns->get_column(  'IVA'  ).
          gr_column->set_long_text(  text-014 ).
          gr_column->set_medium_text(  text-014 ).
          gr_column->set_short_text(  text-015 ).
          gr_column ?= gr_columns->get_column(  'TOTAL_AMOUNT'  ).
          gr_column->set_long_text(  text-016 ).
          gr_column->set_medium_text(  text-016 ).
          gr_column->set_short_text(  text-017 ).
          gr_column ?= gr_columns->get_column(  'CURRENCY'  ).
          gr_column->set_long_text(  text-018 ).
          gr_column->set_medium_text(  text-018 ).
          gr_column->set_short_text(  text-018 ).
          gr_column ?= gr_columns->get_column(  'ZINTERNAL_REFNO'  ).
          gr_column->set_long_text(  text-019 ).
          gr_column->set_medium_text(  text-019 ).
          gr_column->set_short_text(  text-019 ).
          gr_column ?= gr_columns->get_column(  'MATERIAL_AMOUNT'  ).
          gr_column->set_long_text(  text-020 ).
          gr_column->set_medium_text(  text-020 ).
          gr_column->set_short_text(  text-021 ).
          gr_column ?= gr_columns->get_column(  'LABOUR_VALUE'  ).
          gr_column->set_long_text(  text-022 ).
          gr_column->set_medium_text(  text-022 ).
          gr_column->set_short_text(  text-023 ).
          gr_column ?= gr_columns->get_column(  'FAILURE_COST'  ).
          gr_column->set_long_text(  text-024 ).
          gr_column->set_medium_text(  text-024 ).
          gr_column->set_short_text(  text-021 ).
          gr_sorts = gr_salv_table->get_sorts( ).
          gr_sorts->add_sort( columnname = 'AMOUNT' subtotal = abap_true ). "for subtotal
          gr_agg = gr_salv_table->get_aggregations( ).
          gr_agg->add_aggregation( 'AMOUNT' ).
        CATCH  cx_salv_not_found cx_salv_data_error cx_salv_existing.
      ENDTRY .
    Set top of page
      CREATE OBJECT lv_header.
      lv_h_label = lv_header->create_label( row =  1  column =  1  ).
      lv_h_label->set_text(  text-001  ).
      lv_h_label = lv_header->create_label( row =  1  column = 5  ).
      lv_h_label->set_text(  text-002  ).
      lv_h_label = lv_header->create_label( row =  1  column = 14  ).
      lv_h_label->set_text(  text-003  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  04  ).
      lv_h_flow->create_text(  text  =  text-004  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  05  ).
      lv_h_flow->create_text(  text  =  text-005  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  06  ).
      lv_h_flow->create_text(  text  =  name  ).
      set the top of list using the header for Online.
      gr_salv_table->set_top_of_list( lv_header ).
    ALV Display
      gr_salv_table->display( ).
    ENDFORM .                     " DISPLAY_SIMPLE_ALV

    Hi Sridevi,
    To get the grand total, you need to pass the SORT itab to the function module. You need to populate the internal table with the fields on which you want the total or subtotal. If you donu2019t pass this table, you wonu2019t get it.
    For ex:
       ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = gs_plant-werks.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
    So the above code, gives the sub total plant wise.
    and if you want the sum(grand total) you can set the DO_SUM to u2018Xu2019 for that particular field in the field catalog.
    So with this approach, you can get the sub total and grand total for a particular field.
    If you donu2019t want the subtotal, just set DO_SUM, you will get the total.
    Thanks,
    Srini.

  • Hi, I have just tried to update the iPhone software and it appears to be updating but the screen on my phone has had the same picture of the apple and its at the same spot of loading (about 3 quarters) for the last HOUR!! help!

    Hi, I have just tried to update the iPhone software and it appears to be updating but the screen on my phone has had the same picture of the apple and its at the same spot of loading (about 3 quarters) for the last HOUR!! help!

    oh and the device is not being recognised by itunes now either.

  • I had my iPod 5th generation in the wash for about 3-5 minutes, i took it out of my jacket and made the mistake of trying to turn it on. The first time it came on, then never came back on, its been in rice for 6 days, should I try anything else?

    I had my iPod 5th generation in the wash for about 3-5 minutes, I took it out of my jacket and made the mistake of trying to turn it on. The first time it came on, then never came back on, its been in rice for 6 days, should I try anything else? Please help!

    Try:                           
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar                              
    Apple will exchange your iPod for a refurbished one for $99 for a 16 GB 5G and $149 for the other 5Gs. They do not fix yours.
      Apple - iPod Repair price             

  • How much is the final prize for the software of logic pro 9 ?

    hello how much is the final prize for the app logic pro ???

    The price you pay does depend on where you live. In Australia, we pay $209.99 (equivalent to US$219.25). But the price will be somewhere close to US$200.

  • I tried to use the iPhone hot spot feature for the first time to use my kindle outside. I followed the directions n I saw the network came up I used my password and I could not connect. What am I'm doing wrong. Please help

    I tried to use the iPhone hot spot feature for the first time to use my kindle outside. I followed the directions n I saw the network came up I used my password and I could not connect. What am I'm doing wrong. Please help

    I tried to use the iPhone hot spot feature for the first time to use my kindle outside. I followed the directions n I saw the network came up I used my password and I could not connect. What am I'm doing wrong. Please help

  • Reach the Kombustor Benchmark Target and Take Home the Grand Prize!

    Mon, 12 Dec 2011:
    Be the First to Reach the Kombustor Benchmark Target and Win a FREE Tablet PC or Premium Lightning Graphics Card!
    Upload Results from the 3-Minute DX11 Effect Test for a Chance to Win Big!
    Read more at:
    http://www.msi.com/news-media/news/1346.html
    http://www.ozone3d.net/msi_kombustor/dec2011/
    Good luck!

    object {
         display: block;
    Any good?
    Martin

  • Can anyone spot the syntax error of db delete?

    Hi
    I'm trying to get a database delete statement to work for a relations table - it just has studentId and courseId as foreign keys which make up a joint primary key.
    The line is
    db.update("delete from enrollments2 where (studentsid = '" + getStudentId() + "," + " coursesid = " +  getCourseId() + "')");The error is
    ERROR: invalid input syntax for integer: "78, coursesid = 75"Somehow I am putting non integer into an integer... I can't seem to spot the mistake though. Any help would be appreciated.

    The correct syntax I should mention was
    db.update("delete from enrollments2 where (studentsid = '" + getStudentId() + "'and coursesid = '" +  getCourseId() + "')");I'll leave that in for the time being and try to come back to it tonight... its on my todo list.
    Thanks for the snippet by the way, it always saves a lot of time when someone provides a useful snippet towards a solution. I hadn't heard of prepared statements until now too, interesting.
    Message was edited by:
    occams_razor
    -->> missed a 2 out there as enrollments2 is my test case

  • ADM dialog hangs but on debugging it works fine. Can't spot the problem

    Hello,
    I have developed an automate plugin which submits a design on a server using libcurl library. There is a dialog(made using ADM) to submit a design which consists of a submit button and a progress bar. On clicking the submit button, the progress bar starts getting updated. When the progress bar is completely updated the dialog seems to hang. The dialog is supposed to close after submit. The obvious way to search for the problem was to debug the source code, but it appears that whenever the source code is debugged then it runs smoothly. But without any debug points the problem reverts. How can we spot the problem without debugging?
    Please guide.

    In developing plug-ins over the past years I have encountered a few cases where the presence of the debugger seemed to work around a problem.  The debugger necessarily changes the timing and resource allocations some.
    In every case the problem turned out to be a legitmate bug - a mistake we had made in our code, and in some cases finding that bug required other measures beyond using the debugger to help us track it down.  We ended up implementing a very sophisticated logging facility that we use in all our products now.  It appends lines of text containing pertinent info into a log file that's created for each run.  The detailed logging commands compile-out in a Release build, so we just leave them in the source code all the time and they add no overhead.
    Unfortunately, there's no easy answer for your dilemma, other than to advise you to implement your own logging facility - or at least the ability to add printf statements (or similar) into your code so you can trace the progress in sticky situations.
    Though I saw your message and am a plug-in developer myself, you might find you can get more direct help in the SDK forum...
    http://forums.adobe.com/community/photoshop/photoshop_sdk
    Good luck!
    -Noel

  • White screen on my 3gs, i would like to spot the problem if it is a cable problem or an LCD problem?

    after dismantling the iphone 3gs and reassmble it again i got a white screen, i would like to spot the problem if it is a cable problem or an LCD problem?

    Steps for iPhone white screen, #1 Reset. If fixed done. If the screen becomes normal, but then again goes back to white screen, fix is new LCD Display. If remains continuous white screen after Reset, then the problem could be Logic Board or LCD Display, in this situation try a new LCD Display hoping it will fix issue, but will not if problem is Logic Board fault.
    Before opening and during all repair of iPhone 3GS make sure it is OFF. This is why you now have a White Screen, try not to make that mistake again.

  • How to create a simple spot the difference game

    Hi everyone. I'm new to the forums and relatively new to flash, so bear with me
    I'm looking to do a very simple spot the difference game using flash CS3 and actionscript 2 for a school project.
    As it stands, I have 2 images on separate layers on a timeline in the same frame, which has been paused using the 'stop' command. I am looking to have around 4 differences that, when clicked, will be recorded at the bottom of the screen.
    The problem is, I am unable to find a way to get the differences recorded at the bottom in the order the user finds them, where each one is entered when the user clicks it, leaving gaps for those that haven't been found.
    Being only a basic user, I am only familiar with scenes and basic timeline controls, and i'm hoping there's a relatively simple way of achieving this. However I am perfectly comfortable with using more complex actionscript, having done some programming before.
    Thanks in advance,
    Laurence

    Thanks so much for all your help
    Just one last thing about the 'if' script you gave me, what do i replace 'somemovieclip' with if I've already definied the movie clips I want to be monitored? Also, do I put that script on the frame? If not, where? It just doesn't work properly at the moment (skips straight to the completion frame even though the movie clips are hidden at the start) and i'm not sure about those things ^
    Sorry to be of more trouble
    Laurence

Maybe you are looking for