Prepared Statement help -- cant get it to work :(

Context initialcontext = new InitialContext();
          DataSource datasource = (DataSource)initialcontext.lookup("java:comp/env/XYZ");
          Connection conn = datasource.getConnection();                
          String UPDATE = "update query with ?s ";
          PreparedStatement pstmt = conn.prepareStatement(UPDATE);
          pstmt.setString(1,title);
          pstmt.setString(2,desc);
          pstmt.setInt(3,1);
          System.out.println("2a");
          pstmt.executeQuery(); ------- STUCK HERE
          System.out.println("2b");                              
          pstmt.close();
It goes between 2a and 2b and just stops working.. no errors nothing...
I have been trying to get this working the entire day... with no luck... any suggestions........

I am familiar with a few dialects of SQL. I've never seen
UPDATE <tbl> WITH...
What RDBMS are you using? I just searched the mySQL documentation on the keyword WITH (case sensitive) and found no form of update that uses it.
The ANSI SQL UPDATE statement takes the form...
UPDATE <tbl> SET <col> = <value>[, <col> = <value>...]
Also, you have three calls to setString, but only one ? in your String UPDATE indicating a position for a parameter.
http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
Hope this helps. If there is a form of UPDATE that uses WITH, please provide me with a reference link. I'm supposed to know SQL. :-)

Similar Messages

  • Datapump help - cant get it to work

    This is my script:
    create or replace directory EXPORT as 'e:\aia\backup\dmp\';
    declare
         l_dp_handle NUMBER;
    begin
    l_dp_handle := DBMS_DATAPUMP.open(
    operation => 'EXPORT',
    job_mode => 'SCHEMA',
    remote_link => NULL,
    job_name => 'GTAIATB4_UPGRADE_EXP4',
    version => 'LATEST'
    DBMS_DATAPUMP.add_file(
    handle => l_dp_handle,
    filename => 'GTAIATB4_UPGRADE2.dmp',
    directory => 'export',
         filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
    DBMS_DATAPUMP.add_file(
    handle => l_dp_handle,
    filename => 'GTAIATB4_UPGRADE2.log',
    directory => 'exportT',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE
    DBMS_DATAPUMP.metadata_filter(
    handle => l_dp_handle,
    name => 'SCHEMA_EXPR',
    value => 'IN (''GTAIATB4_UPGRADE'')');
    DBMS_DATAPUMP.start_job(l_dp_handle);
    DBMS_DATAPUMP.detach(l_dp_handle);
    END;
    I want to export everything that belongs to the schema called GTAIATB4_UPGRADE.
    this is the result:
    SQL> declare
    2 l_dp_handle NUMBER;
    3 begin
    4 l_dp_handle := DBMS_DATAPUMP.open(
    5 operation => 'EXPORT',
    6 job_mode => 'SCHEMA',
    7 remote_link => NULL,
    8 job_name => 'GTAIATB4_UPGRADE_EXP4',
    9 version => 'LATEST'
    10 );
    11 DBMS_DATAPUMP.add_file(
    12 handle => l_dp_handle,
    13 filename => 'GTAIATB4_UPGRADE2.dmp',
    14 directory => 'export',
    15 filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
    16 );
    17 DBMS_DATAPUMP.add_file(
    18 handle => l_dp_handle,
    19 filename => 'GTAIATB4_UPGRADE2.log',
    20 directory => 'exportT',
    21 filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE
    22 );
    23 DBMS_DATAPUMP.metadata_filter(
    24 handle => l_dp_handle,
    25 name => 'SCHEMA_EXPR',
    26 value => 'IN (''GTAIATB4_UPGRADE'')');
    27 DBMS_DATAPUMP.start_job(l_dp_handle);
    28 DBMS_DATAPUMP.detach(l_dp_handle);
    29 END;
    30
    31
    32 /
    declare
    ERROR at line 1:
    ORA-39001: invalid argument value
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3444
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3693
    ORA-06512: at line 11
    Also, can someone tell me how I can delete the jobs that were created as now I have to keep adding job names ie 'GTAIATB4_UPGRADE_EXP4' started as 'GTAIATB4_UPGRADE_EXP', then 'GTAIATB4_UPGRADE_EXP3' etc etc

    There could be lots of things wrong with this pl/sql script. If you need to change the job name every time, then I can tell you that at least the open is happening, because it is creating the master table. After that, I have no idea what is happening. One thing I would do is to add some sort of debugging into the code so you can figure out what is happening. I use an internal tool to help debug pl/sql, but a simple thing would be to do an insert into a table after every call. Something like this:
    first create a table that is owned by the schema running the job.
    create table debug_tab (a number);
    then in the code, I would put a statement like this after every datapump call:
    insert into debug_tab values (1);
    commit;
    then
    insert into debug_tab values (2);
    commit;
    etc. Then after you run your script, look to see what is in debug_tab. This will tell you how far you got. Some of the things I would look at would be to make sure that the directory exists.
    Actually, I think I just saw it. For the dumpfile, you have the directory as 'export'
    for the log file, you have the directory as 'exportT' <---- you have both lower t and upper T. This is probably your problem.
    As for getting rid of existing jobs,
    select * from user_datapump_jobs;
    then
    drop table 'job_name';
    This will get rid of the Data Pump job.
    Hope this helps.
    Dean

  • Please Help, cant get 8i Enterprise working on my system...cant get into sql plus

    Hello,
    I am trying to get my oracle 8i working. I installed it, and it went ok, except two optional programs didnt work, though it was recommended to get them working, i didnt know how and just went on. Also some of the programs are not working either...which i dont understand since the software installed successfully.
    I am using 8i enterprise on my win2k system. I am not on a network and am using it only on my local machine. I CANNOT get into Sql Plus as it is asking me for a user/password/host string. i tried so many combinations. scott/tiger, system/manger, sys/system_change_on_install and various other things on this discussion board.
    Nothing is working for me and I have no idea whats wrong. I have used installed Oracle systems before and used to just login those systems as scott/tiger and no problems. This is the first time i have installed it from scratch and i havent been able to get into the system.
    Any help would GREATLY be appreciated. Thank you.

    the programs that do not work are:
    Database Configuration Assistant
    INTYPE File Assistant
    Net 8 Assistant
    Net 8 Configuration Assistant
    Net 8 Easy Config
    I click the programs and nothing happens. Not sure even if something is supposed to happen though.
    the error when i type in the pass/user is:
    ORA-12560: TNS: protocol adapter error
    thank you for helping.
    samir.

  • I cant get itunes to work on my new Sony Vaio. Im running Windows 8.1.

    i cant get itunes to work on my new Sony Vaio. Im running Windows 8.1. Anyone have a fix?

    Hello philtapevans,
    The following article provides information and steps that can help get iTunes installed on your computer.
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Cheers,
    Allen

  • Set up ipod touch to cox email, ive tried everything and cant get it to work. thanks!

    set up ipod touch to cox email, ive tried everything and cant get it to work. thanks!

    Here's an answer from the net:
    Go to Settings/Mail,contacts,calendars/Add account choose other, choose Add Mail Account. Fill in name, email address, password and description on the screen that comes up. Save those.
    One the next screen tat comes up click om POP in the first line then fil in the host name as
    spop.west.cox.net or spop.east.cox.net or the one to go with your region.
    Note that is not a misprint, that is spop (secure pop)
    Fill in your username one more time (the password should have carried over from previously)
    Fill in your outgoing mail server like smtp.west.cox.net (change for your region) and click Save.
    When all the settings are verified a checkmark will appear next to them all and you are good to go.
    If it says something like "can't connect via SSL would you like to ..." then you probably missed the step about selecting POP on the second screen and are trying IMAP so go back and try over with POP. Or perhaps mistyped soemthing.
    Once everything is working you can go back into the settings and see that it has automatically connected on port 995 and that SSL is on
    Note that you probably won't be able to send email from a wifi in a cafe or similar as cox won't let you connect to their smtp from outside their network.
    I haven't tried receiving mail from a non cox connected wifi yet but I suspect it will work just fine. Anyway these settings work for me using my ipod to my home wifi router connected to cox.
    I could not find a definitive guide when I searched so I hope this helps other folks trying to configure this.
    I got the spop from "Mail for Mac OS X 10.5 configure SSL / POP" here:
    http://support.cox.com/sdccommon/asp...c-7f95e8bcaf39

  • HELP cant get it to get music, frusterated into te

    ok, i got it for christmas, and i was realy looking forward to getting it going cause i have an mpc port in my car and i dri've alot, well...you get the drift, either way, i cant get it to work, i tried calling the customer support, but forgot they were closed, and now im stuck, and confused. there was no manual or n e thing on how to work the desktop items (media explorer and organizer, and i never got this toolbar thing they siad would be there) but anyway, i finaly got all of it figured out, got my musick on to thoes programs fine, and then transfered them to wat was supposed to be my zen...i took my zen, and went to go dri've, and realized..there was not music on it, so i pluged it back in, and now it wont prompt the transfer, and so i checked through the computer to see what was actualy on my zen, and it says my songs are on it and its in a playlist, but THEYRE NOT im so confused, dont know how to work the organizer, or explorer, and all i want is my music...can anyone help?

    Right it seems we are not alone, i ran a search in the forum - this particular problem with MacPros appears to have been around since February 2008 but none of the posts got a reply so I guess the issue is lying dormant. I'm going to call AppleCare tonight and report it and if they don't have a solution I will be requesting a refund until it's sorted out. After my £4k G5 Quad died for hardware faults just 15 months down the line I'm particularly wary of quality control and don't want to burned twice at this price.

  • I cant get ECWID to work on my mobile devices, it only seems to use the desktop site rather that the Tablet or iPhone

    I cant get ECWID to work on my mobile devices, it only seems to use the desktop site rather that the Tablet or iPhone? Can anyone help me?

    Hi Jim,
    We’ll be glad to help you.
    Ecwid supports responsive layout, which means that the store pages can adapt to the visitor's screen width on the fly and keep the layout clean and nice. Your products and categories lists will be fit for any window's size, as Ecwid will calculate the most suitable number of products or categories in row automatically. In other words, Ecwid looks great on any mobile devices. You can check how your Ecwid store may look on smartphones and tablets, if you see your Starter Site (what it is).
    However, if you want Ecwid reveals itself in all its glory, you should embed your Ecwid store into website, which also support responsive layout, because if the site doesn’t adapt to size screen, Ecwid is not able to determine how it should be changed since it’s just a part of the site.
    We’ve checked your site and found that you used Adobe Muse for building your site. Using Adobe Muse, you can create alternate site layouts for web content to be displayed on desktop, smartphones, and tablets. Nonetheless, your site has a layout for desktops only, that’s why it looks the same on all devices. You can learn how to create those alternate layouts in Adobe Muse, by reading “Creating a Website for Mobile Devices” article.
    I hope this helps! But if there are any questions, don’t hesitate to reach us out on Ecwid forums.

  • Cant get Frontrow to work after installing 10.4.3 and updating it

    I made a terrible mistake today and moved all my files from my harddisk to my external harddisk. I had to reinstall everything but I cant get frontrow to work properly. I cant find it on my external harddisk either.
    Can someone please help me with this tricky question.

    Winbo:
    Can you describe your problem in a bit more detail? Why did you decide to move your files? What files did you move? What method did you use to move them? Did you move them over completely by way of backing up and then erased your disk prior to moving them back?
    Any other information you can provide will make it easier to make suggestions on your issue.
    Good luck.
    cornelius
    PismoG4 550, 100GB 5400 Toshiba internal, 1 GB RAM; Pismo 500 OS X (10.4.5)   Mac OS X (10.4.5)   Beige G3 OS 8.6

  • Cant get wifi to work on ipod

    cant get wifi to work on ipod

    would help if you added more then that
    as in what set up is on your router, what have you tried etc

  • [solved]passenger + nginx + rvm cant get nginx to work

    Hello ,
    I am trying to install   passenger-install-nginx-module from the wiki of ruby on rails. I removed my existing nginx but
    but now I cant get nginx to work from the /opt/nginx location. I am getting
    ruby-2.0.0-p481 [ytsejam@ytsejam ~]$ nginx -v
    bash: nginx: command not found
    If I try with "pacman Ql nginx "
    ruby-2.0.0-p481 [ytsejam@ytsejam ~]$ pacman -Ql nginx
    error: package 'nginx' was not found
    but I can enter the directory of /opt/nginx by using cd command.
    can anyone help me ?
    Last edited by ytsejam (2014-08-26 08:25:52)

    I'm happy to see that nginx-passenger had what you were looking for. If you encounter any problems, please don't hesitate to leave an AUR comment or submit a pull request!

  • Strange problem. I have upgraded to OSX 10.9.1 but cant get wifi to work so forced to be hard wired. Any inputs appreciated.

    Hi All,
    Strange problem. I have upgraded to OSX 10.9.1 but cant get wifi to work so forced to be hard wired. Any inputs appreciated. Problem is I cant even reinstall it as I saw on a thread reason, it needs wifi to begin.

    It only needs an internet connection - wired or wireless.
    Fixing a Mavericks Installation Problem
    How to manage a failed OS X Mavericks installation | MacFixIt - CNET Reviews.
    Try these in order:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • Apple Please sort out the V 11.1.4 problems as I cant get iTunes to work now. You need to have a new version asap

    Please sort out the V 11.1.4 problems as I cant get iTunes to work now. You need to have a new version asap

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • Cant get facetime to work on mini ipad

    Cant get FaceTime to work on new mini IPad....any suggestions? It keeps verifying but it will not work, it allows me to get apps. Triple checked that the Apple ID and password is correct, checked the settings to make sure they are turned on, able to get imessage, not sure what the problem could be?

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Extra FaceTime IDs
    http://tinyurl.com/k683gr4
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Fix Can’t Sign Into FaceTime or iMessage iOS 7
    http://ipadtutr.com/fix-login-facetime-imessage-ios-7/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457
    Send an iMessage as a Text Message Instead with a Quick Tap & Hold
    http://osxdaily.com/2012/11/18/send-imessage-as-text-message/
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • Cant get bluetooth to work on iphone 5 wont even discover divices

    Cant get bluetooth to work on iphone 5 wont even discover divices

    supported bluetooth profiles http://support.apple.com/kb/ht3647
    what are you trying to connect your device to?

  • Cant get query to work

    can anyone see what i'm trying to do here?:::
    <cfquery name="display_log"
    datasource="allied_control_db1">
    SELECT *
    FROM ops_log_entry
    ORDER BY log_entry_date_time DESC
    </cfquery>
    <cfquery name="get_current_status"
    datasource="allied_control_db1">
    SELECT *
    FROM new_log_entries
    WHERE #display_log.ID# =
    #get_current_status.id_original_entry#
    </cfquery>
    i want to pull the 'current status' of an entry from another
    table where the ID of 'ops_log_entry' matches that of
    'new_log_entries'
    everything work except this line:
    WHERE #display_log.ID# =
    #get_current_status.id_original_entry#
    i dont think i'm far off but just cant get it to work.
    anyone?

    Hi Phil,
    i'm always carefull not to use reserved words as i spent
    nearly 24 hrs pulling my hair out before trying to figure out why a
    query wasnt working, so i'm pretty sure its not that.
    i havent added anything to the query apart from the date/time
    column name.
    <cfquery name="display_log"
    datasource="allied_control_db1">
    SELECT *
    FROM ops_log_entry AS L INNER JOIN new_log_entries AS N
    ON ( L.ID = N.id_original_entry )
    WHERE N.log_entry_date_time = (SELECT
    MAX(N1.log_entry_date_time)
    FROM new_log_entries AS N1
    WHERE N1.id_original_entry = N.id_original_entry)
    </cfquery>
    ive checked the DB column types and the ops_log_entry.ID is
    of course an AutoNumber (long integr) & the
    new_log_entries.id_original_entry is a Number (long integr)
    so seen as they are both the same types, should there be any
    need for single quotes?

Maybe you are looking for