Problem with GenericCatalogDAO  JDBC Resultset using parameters not working

Hello
I have a problem with Petstore GenericCatalogDAO. java. The problem is the behaviour of the resultset object when retrieving data from the database.Below are two synareos one that
works (when) hard coded and one that does not work when parameter values passed into the the result set.
1. The code the WORKS.
statement = connection.prepareStatement("select a.productid , name, descn from product a, product_details b
where a.productid = b.productid and locale= 'en_US' and a.catid = 'FISH' order by name"
,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
resultSet = statement.executeQuery();
resultSet.absolute(1);
String s = resultSet.getString(1);
The code that gives me a 'exhausted resultset' error which I think means no results
String[] parameterValues = new String[] { locale.toString(), categoryID };(For example parameters are 'en_US' and 'FISH')
statement = connection.prepareStatement("select a.productid , name, descn from product a, product_details b
where a.productid = b.productid and locale=? and a.catid =? order by name"
,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
for (int i = 0; i < parameterValues.length; i++) {
statement.setString(i + 1, parameterValues[i]);
resultSet = statement.executeQuery();
resultSet.absolute(1);
String s = resultSet.getString(1);
There is obviously a problem using these named parametevalues with these preparedstatement resultset, Does anybody know anything about this and a fix for it????
Cheers. Roger

Which version of PetStore are you using?
-Larry

Similar Messages

  • Vine.co can not watch videos on other browsers do not have the problem with firefox firefox there just did not work, delete cookies, history

    vine.co can not watch videos on other browsers do not have the problem with firefox firefox there just did not work, delete cookies, history

    I think this problem may be caused by Yahoo's changes making it incompatible with the klatest version of FireFox.
    This is suddenly affecting many many people who use Firefox and are members of Yahoo Groups. All these people say they themselves changed nothing and have not been locked out before when using Firefox. But suddenly, within the last week, they are.
    What did Mozilla do or what did Yahoo do to cause this problem? I can say that I was not blocking cookies and after trying a number of things to fix it, I went to Yahoo's home page and navigated to my group from here.
    This problem is not anything a user did. Either Firefox is at fault or Yahoo is. I want to know which company is at fault and when they are going to fix it.

  • There is a problem with my apple watch.it is not working well .There is a problem in its charging .The repairers says that contact to your company and ask them to provide you its software. Please help me.

    There is a problem with my apple watch.it is not working well .There is a problem in its charging .The repairers says that contact to your company and ask them to provide you its software.
    Please help me.

    Please be aware that you are not communicating with Apple when you post in these forums. These are user-to-user support forums, so in almost all cases the only people who will reply to your posts are, like me, your fellow users.
    As to your issue, Apple does not and never has made a wristwatch as such. The only thing close to a watch that they have made was the 6th-generation iPod nano:
    http://support.apple.com/kb/ht1353#iPod_Nano_6G
    which has a clock feature and which some people have worn as a wristwatch. Is that what you mean?
    Message was edited by: varjak paw

  • Beginner Has Problem With Loading JDBC Driver Using MySQL

    Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
    1. I have installed MySQL (C:\mysql), created a databse (soup), and created a littel table (VIDEOS). I am able to see the table in the console:
    sql> select * from videos
    2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
    3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
    4. MySQL server is running
    C:\> C:\mysql\bin\mysqld-nt --standalone
    5. open another DOS window and use the database
    mysql>USE SOUP
    6. succesfully compiled a Java program (javac Test.java):
    import java.sql.* ;
    public class Test
    public static void main( String[] args )
    try
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    try
    Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/soup" );
    try
    Statement statement = con.createStatement();
    ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");
    while ( rs.next() )
    System.out.println( rs.getString( "TITLE" ) );
    rs.close();
    statement.close();
    catch ( SQLException e )
    System.out.println( "JDBC error: " + e );
    finally
    con.close();
    catch( SQLException e )
    System.out.println( "could not get JDBC connection: " + e );
    catch( Exception e )
    System.out.println( "could not load JDBC driver: " + e );
    7. when I run the Java program (java Test), I got
    the message:
    could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    What am I missing?

    Hi,
    I missed to specify test in my last post.
    Try running your program by explicitly setting the classspath when
    running your program . java -classpath c:\mysql-connector-java-3.1.0-alpha-bin.jar test
    Make sure your jar file contains org.gjt.mm.mysql.Driver class

  • I'm having serious problems with Lightroom plug in for Facebook not working on my iMac. Help!

    It started about a month ago with LR4. I kept getting problems with not being able to publish to Facebook because of problems with the plug-in which had been working perfectly up to then. I had a run round that worked by disableing and reloading the plug in. I upgraded to LR5 but the problem persisted and in fact just became worse. I can no longer publish to facebook from LR. I deleted the LR app in facebook as someone advised but now I cannot re-authorise with Facebook. When I go to the "connect" buton nothing happens. This is a serious problem that may make me reluctantly abandon Lightroom if I cannot find a solution. Can anybody help?

    According to the Lightroom Facebook page, Facebook broke it and Facebook has to fix it- there is no ETA.
    You can read several posts here (with Adobe responses as well) https://www.facebook.com/lightroom?fref=ts&filter=2

  • I´m having some problems with dates intervals. It´s not working well. I inserted the correct date between the right interval but the system refers to incorrect date? What shoul I do?

    Mensagem editada por: Mauricio Galletti
    It seens that there´s some problem with the specific date of 19/10/2014? Don´t know why? I just remove this date from the interval and the problem gone.
    What´s wrong with 19/10/2014?

    Hello Galdr,
    Welcome to the HP Forums.
    I see that after doing some updates, you've lost the use of switchable graphics in your Notebook. I will do my best to help you with this.
    You can try is to use the HP Recovery Manager. This will allow you to "recover" the Notebook and reinstall the original drivers. This document: Using Recovery Manager to Restore Software and Drivers (Windows 7), can assist you with that.
    Once the drivers are "reverted", then if you wish you can attempt updating.
    This first thing I will provide you in regards to updating is this document: Switchable Graphics on Notebooks Configured with Dual AMD GPUs. There is more general information than anything, but you may find it useful.
    When going to update you will want to use the website or the HP Support Assistant. These are the recommend ways to update. When using AMD's (or other OEM utilities) they will look for compatible drivers for the component, but not necessarily ones that work with your Notebook. What most likely happened, only one of the two drivers were actually updated.
    Here is a link to the newest driver provided by HP: AMD High-Definition (HD) Graphics Driver. Also, here's a link to using the HP Support Assistant: Using HP Support Assistant (Windows 7). (in case you wanted to learn more/use this method).
    I hope this is able to help you get back to "state 1", so that you may be able to update correctly and have full functionality of your switchable graphics again. Please let me know how this goes for you. Thank you for posting on the HP Forums.
    I worked on behalf of HP.

  • Problem with Macbook Pro early 2011, webcam not working in any apps and windows 7 or 8 on bootcamp, keyboard backlight not working?

    Hi Guys
    I recently bought a second hand early 2011 Macbook Pro 15 inch and are having 2 problems. The first is that none of the apps detects my webcam at all, the second is, i have Windows 8 installed on bootcamp but are unable to get the keyboard backlight to work in 7 or 8. The backlight works perfect in os x 10.8.5 though. I need a little bit of help guys.....

    Go to Apple Menu / About This Mac. Click on More Info ... next on System Report. In the left hand column, under Hardware, select USB. The right side will show the USB Device Tree. Look through that and check for "Built-in iSight". That is your camera. If it is not listed the camera is not working.
    For backlighting, try this: go to System Preferences / Keyboard. Uncheck "Adjust keyboard lighting in low light".

  • I have a problem with my Iphone 5 all sounds not working

    sounds not working at all with my iphone 5.

    Hi Ali147,
    Welcome to the Support Communities!
    The following article will provide some troubleshooting steps for this issue:
    iPhone: Can't hear through the receiver or speakers
    http://support.apple.com/kb/TS1630
    Hope this helps ....
    Judy

  • WINDOWS 2008 R2 WITH WINDOWS 8 WALLPAPER USING GPO NOT WORKING

    I have come across a really annoying problem with Active Desktop Wallpaper GPO on
    Windows 8
    It is set to redirect to a wallpaper which is located in a dir on the
    server.
    when the user first logs onto a windows 8 PC, the correct background is applied.
    however when I change the background on the server... the user will still get the
    previous background on the windows 8 computers. If i click personalisation it shows the updated wallpaper but it simply won't
    refresh to it!
    The only way to get it to work is removing the users local / roaming
    profile and then the updated wallpaper is displayed!
    the wallpapers work fine on XP and Windows 7 PC's...
    PLS HELP
    SUNIL PATEL SYSTEM ADMINISTRATOR

    I get this problem.
    I just change the name of the wallpaper each time and that sort of works...sort of however some users still are stuck with the old wallpaper. It must be caching it somewhere in their profile.
    and then I found the post at the bottom of this page:
    created a batch file:
    @echo off
    echo.
    REG ADD "HKCU\Control Panel\Desktop" /f /v "TranscodedImageCache" /t REG_BINARY /d ""
    echo.
    echo Import Complete.
    put that on user log off policy and now it appears to have started working!

  • Problem with Sender JDBC adapter using StoredProcedures

    Hi All,
    I am facing some prblem when i am using StoredProcedure. Please look at the error which i observe in the traces when i try to execute a stored procedure using Sender JDBC channel.
    SQLException during query 'execute MAG_C0210.dbo.biz_mag_ubicaciones  @data="MAG_C0210" , @idciclovida=" ", @idmaestro=" ", @idtiporeplicacion=" "':com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set
    Please help me in this regard ASAP.
    Cheers,
    Soorya

    Hi Praveen,
    It is working fine when i executed the same in the SQL editor but when I use with XI it is failing with error
    mentioned earlier. Please check this and help in solving this asap.
    Regards,
    Soorya

  • TS2932 problems with aperture 3.4.3  adjustments not working on latest photos upload to iPhoto library

    I recently uploaded some raw photos taken with a nikon D40x to my iPhoto library.  Did some cropping and adjustments in iPhoto.  Next I opened that library and that project in Aperture, and tried to do some furter adjusting.  Pictures became distorted.  At first they looked liked fine but as soon as I tried to do adjustments the pictures darkened, had less definition and looked hazy.  I tried to reprocess with no success.
    I then performed the apple check on my photot using the > filter feature > add rule > "filter type" is "raw", > adjustments "do not include"  "raw decode version 3".  The only photos in my entire iPhoto library that do not meet those criteria are the new pictures in question. I do not know what to do.

    Not sure of the meaning, but you should launch Aperture while holding down alt/cmd. Use the repair options starting at the top and checking Aperture after each one.

  • Problems with Godaddy email webmail WBE plugin not working w/ FF

    While the basic email is working the plugin WBE fails to work properly
    Please get back to me ASAP on fixing this. Prior to the last two updates to FF Fire Fox worked just fine
    The WBE plugin does work with IE but '''not with Fire Fox 3.6.12?'''

    Again IE8 works fine now but Firefox does not allow me to embed jpegs or png files like it used to in my webmail.
    The URL:
    http://email00.secureserver.net/pcompose.php
    See the uploaded image so you can see what happens when I paste.
    I get a broken image picture in the upper left corner
    While the picture and the tag seems fine the picture fails to render in FireFox. Any idea why
    Here is the source:
    <img src="file:///C:/Users/Robert/AppData/Local/Temp/MYFILE.PNG" width="826" border="0" height="665">
    This used to be added as an ebedded file but clearly its being added as a linked file? How do I fix that???

  • Problem with join / explicit field declaration does not work

    Hello together,
    there is something I do not understand about the join. I have a join over two tables (see below). The field AENAM exists in both tables but I want to have it coming from ZDPP_VERBRAUCEFF.
    BUT the system gives me the values from MARA although I define the source ZDPP_VERBRAUCEFF.
      SELECT zdpp_verbrauceff~mandt
             zdpp_verbrauceff~matnr
             zdpp_verbrauceff~zzmdv01
             zdpp_verbrauceff~begda
             zdpp_verbrauceff~endda
             zdpp_verbrauceff~vmeng
             zdpp_verbrauceff~vmeng_m
             zdpp_verbrauceff~aenam     "Problem
             zdpp_verbrauceff~aedat
             zdpp_verbrauceff~aezet
             zdpp_verbrauceff~prfdt
             zdpp_verbrauceff~prfzt
        FROM zdpp_verbrauceff
        INNER JOIN mara
        ON zdpp_verbrauceffmatnr = maramatnr
        INTO TABLE lt_ver_db
        WHERE zdpp_verbrauceff~zzmdv01 IN s_mdv01
          AND zdpp_verbrauceff~begda   <= s_datum-high
          AND zdpp_verbrauceff~endda   >= s_datum-low
          AND mara~mtart               IN s_mtart
          AND mara~matnr               IN s_matnr.
    Can anybody tell me what I doing wrong?
    Thanks in advance,
    Sebastian

    Can you try change the statment sequence as I have below and see if this works i.e:
    SELECT zdpp_verbrauceff~mandt
    zdpp_verbrauceff~matnr
    zdpp_verbrauceff~zzmdv01
    zdpp_verbrauceff~begda
    zdpp_verbrauceff~endda
    zdpp_verbrauceff~vmeng
    zdpp_verbrauceff~vmeng_m
    zdpp_verbrauceff~aenam "Problem
    zdpp_verbrauceff~aedat
    zdpp_verbrauceff~aezet
    zdpp_verbrauceff~prfdt
    zdpp_verbrauceff~prfzt
    FROM zdpp_verbrauceff
    INTO TABLE lt_ver_db   "LINE MOVED to here
    INNER JOIN mara
    ON zdpp_verbrauceffmatnr = maramatnr
    WHERE zdpp_verbrauceff~zzmdv01 IN s_mdv01
    AND zdpp_verbrauceff~begda <= s_datum-high
    AND zdpp_verbrauceff~endda >= s_datum-low
    AND mara~mtart IN s_mtart
    AND mara~matnr IN s_matnr.
    Regards,
    Warren.

  • Transport request problem with an include prog ... not working

    Hello people I am in a predicament here. I have this SAP Enhancment program with a screen and include code
    <b>screen:
    SAPLITO01080_XUSR1080_SAPLXTOB1000
    include:
    ZXTOBI01</b>
    right now it can be found either in the function grp XTOB or a project made by us (can be found in CMOD).
    When I released the Transport Request with both of the above included. The screen SAPLITO01080_XUSR1080_SAPLXTOB1000 was sent to the prd server but the include code ZXTOBI01 didnt. I tried saving and creating a transport while editing it in XTOB and my project (ZPMTECH), and it still wont work. If any of you can give me some help regaring this I would be ever greatful. Thanks guys and take care.

    <b>"Try to see the code of your user exit in PROD, it seems the statament INCLUDE ZX...... is missing."</b>
    This is in DEV: In the SAP Enhancments ZPMTECH, the thing is here is that my enhancment comes from a screen. So I just add modules and click on the module and created an enhancment. the include code cannot be seen in ZPMTECH but it can be seen in the function XTOB. However in PRD XTOB does not have the include program nor the modules, but has the screen.
    <b>"In your request there should be only the include, not function (user-exit)."</b>
    That is how I have transporting it, still doesnt work unfortunatley.
    Thanks.

  • I'm having problems with my push notifications.Facebook,gmail not working. (iPhone 4 4.2.1) any ideas?

    Anybodys phone is doing the same? It started today. I'd really hate to restore. Any thoughts thanks

    Tried to reset network settings however it is still same. Added another gmail account and somehow it is working :S. Checked account settings on gmail and iphone. Settings are correct and imap is enabled. When I tried to check my e-mail it says "username and password don't correct"
    Tried to delete account and add again but no change.
    I am not sure what is the problem.

Maybe you are looking for

  • Real Instruments Feedback Garageband 08

    I bought ilife 08. I usually use Protools to record with my Mbox but I wanted to screw around with Garageband. I can not for the life of me get real instruments to work. When it records all i get is a feedback loop from the moment I hit the record bu

  • ACR 4.4.1 opening 8-bit TIFFs as 16-bit TIFFs

    I have a number of 8-bit sRGB TIFFs produced from scans of 35mm colour slides by the Epson Perfection 4990 Photo scanner. Am using Win XP Pro SP3. If I open these images from Bridge 2.1.1.9 directly in Ps CS3 10.0.1 they are correctly shown in File I

  • Where do I get the activation code in order to watch ESPN

    Where do I get the activation code to watch espn on my apple tv?

  • Simple Web App NOT working with JBoss on IDEA IntelliJ

    Hi Experts: I am using TOMCAT_4.0.3 (bundled with JBOSS_3.0.0) and using IntelliJ-IDEA as my IDE environment. On one of my machine I created a WEB-APP kithany.war. It was working fine on this machine. Later when I copied this kithany.war to other mac

  • EXCEPTION [TOPLINK-116]

    Can anybody help me with the following error, what does it mean: 2007-07-12 16:45:45,813 [ContentScheduler_Worker-2] ERROR (com.jcatalog.scheduling.quartz.Executer) - Unexpected error during execution of Job LOCAL EXCEPTION STACK: EXCEPTION [TOPLINK-