Problem with SQL connection and a Collection

hi all,
I have two problems with sql...
1. how can I assign the values of a resultset to a collection?
2. how can I close the sql connection, because when I close the statement and connection error shows me in the resultset
thanks!

Hello Pablo,
RetrivingResults In Collection:
1)   use getObject method, and assign it to collection.
          Collection c_obj=new ArrayList();
         while(rs.next())
                c_obj.add(rs.getInt(Project_ID), rs.getString(Project_Name));
Closing ResultSet
2)               The close() methos of ResultSet closes the ResultSet object, like bellow
                ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
                rs.close(); //Closes the result set

Similar Messages

  • Since upgrade to ios6 l have been having problem with wifi connection and connecting to App Store and iTunes store

    Q since upgrade to iOS6 l have been having problem with wifi connection and getting into App Store and itunes

    Saw this on another post.
    Applecare Senior Advisor Txx Bxxx (I have his contact info in an email he just sent) just confirmed with me that the problem people are having with the App Store not loading is an apple issue with there servers, ITS NOT YOUR IPAD so don't go restoring it!   It's not happening to everyone however but they are looking into it, its really hit or miss.
    In the meantime ...........
    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    Try this first - Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
    ~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting
    http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet
    http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Problems with sql developer and win 8 64 bit

    Hi there,
    It's my first time in this forum, I am a student programmer and I have many problems to install SQL Developer on Oracle Database 12c. I actually managed to install both, but I could not make them work. My question is SQL Developer works on the Windows 8 platform 64-bit?
    I'm going crazy, help me please .... Thanks for a while!!!

    SqlDeveloper should have no problem working in Win 8, but i do not think it's a supported platform yet.
    The Database could be a little more troublesome, if you only need a working database environment to make experiments you could find the "pre-built" Virtual Machines useful.
    For Win 8 and 12c try using the EA release of SQLDeveloper 4, because if I'm not mistaken the current 3.2.2 could have some problems with 12c.

  • Problem with SQL Authenticator and SOA EM console.

    Hi,
    In my project, i have a need to authenticate USERS from data base tables. To acheve this i defined SQL Authenticator, inside the weblogic admin console.But, problem is after this, when i login to EM console of SOA, then, in the home page, it is showing all deployments as DOWN sate, including SOA-INFRA. But, i am able to deploy BPEL project and execute it normally. Why EM console is showing all deployments and soa-infra as down?.
    Thanks,
    Naga.
    Edited by: 984573 on Feb 5, 2013 9:56 PM

    Hi Anuj & Nicolas,
    Thanks for your reply.
         Really wonder, i found the solution. This is the problem with order of Authentication provider. If i put the "SQL Authenticator" in the top of the order as the first item in the list, then i am facing the above error in EM console. Now, i re-ordered the "SQL Authenticator" and keep it last in the list. Now, SOA EM console is working fine. I really do not understand, what is the significance of the order of Authentication provider.
    Thanks for your help.
    Regards,
    Naga.

  • Problems with internert connect and OS X 10.4.11

    Ever since I installed Tiger and then updated to 10.4.11, I have been having a frustrating problem on both of my computers.
    On my IMac, when I click on connect (Internet connect), it tells me that authorization has failed. I open system preferences Network and click on assist me, then open diagnostics. As it goes through the diagnostic routine, the internet connection opens, and the network diagnostics says that the internet connection appears to be operating normally. When I close the connection and then try to open it with internet connect, same thing. Check diagnostics, same thing.
    On my eMac, I cannot connect at all. The diagnostics says that the ethernet is not plugged in...it is not recognizing the connection. I unplugged the ethernet cable and plugged it into my laptop. Same cable, same setting, same everything. It works fine. So, I'm guessing it is something in the software. I have repaired the permissions and the system. Verification says No problems.
    Any suggestions? Please!
    Abe

    Hi Abe, and a warm welcome to the forums!
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these files to the Desktop, then trash the originals since move only copies them...
    /Library/Preferences/SystemConfiguration/preferences.plist
    /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
    /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
    /Library/Preferences/SystemConfiguration/com.apple.nat.plist
    Then move these...
    /Users/YourUserName/Library/Preferences/ByHost/com.apple.networkConnect.<12 digit number>.plist
    /Users/YourUserName/Library/Preferences/com.apple.internetconnect.plist
    Go to System Preferences
    Click Network
    Highlight AirPort and click Configure...
    Choose “By default, join: Preferred networks”
    Select your access point and Remove your access point with the minus button.
    Launch your keychain access in Utilities and delete your access point keychain entry.
    Reboot

  • Problem with Hibernate Connection and MySQL

    I have the following setup:
    J2EE web-application, Java Servlets, Jsp, Hibernate for DB persistence, MySQL 4 (InnoDB tables)
    I have not specified any connection pool parameters (c3p0) in my hibernate.cfg.xml, as the default settings should suffice for my purposes.
    I use the SessionFactory object as follows.
    In my database access class, I have a static declaration that initialises the new SessionFactory.
    Then, I use Session session = sessionFactory.getSession(); and session.close(); to do my DB access.
    Likewise, when storing data into the DB, I use a Transaction object, and use transaction.commit(); at the end of database access.
    The problem is:
    When I store data into the database, the changes do not occur on the website. In other words, the data gets stored into the tables (I check that via phpMyAdmin) but when accessing it, it only gets the old data. This is a serious problem as I am developing a website with attached CMS that will be used to update the pages.
    The OTHER problem is:
    Instead of having a static initialisation of the SessionFactory object, I created a new one every time I needed to access the database. Although I had a sessionFactory.close(); statement at the end of the database acccess, I got an exception:
    "java.sql.SQLException: User db_user already has more than 'max_user_connections' active connections"
    At the very moment I don't have access to my code.
    If somebody has a suggestion or a solution to the problem, please reply.
    Also, I will supply any code that is necessary to identify the problem.
    Anders

    Thanks for the tip, but how do you mean to update the object?
    Here is the code that stores the data into the database:
    'sessionFactory' is a static SessionFactory object.
         public static int saveOrUpdate ( Object object ) {
              int flag = 0; // 0 is true
              LOG.info("CMSLogic >>> saveOrUpdate() - object: " + object );
              Session session = null;
              Transaction transaction = null;
              try {
                   session = sessionFactory.openSession();
                   transaction = session.beginTransaction();
                   LOG.info("CMSLogic >>> saveOrUpdate() - object to save or update: " + object );
                   session.saveOrUpdate(object);
                   // Flush the session
                   if ( session!= null )
                        session.flush();
                   transaction.commit();
              } catch ( Exception e ) {
                   e.printStackTrace ();
                   transaction.rollback();
                   flag = 1;
              } finally {
                   try{
                        if (session != null) {
                             session.close();
                   } catch (Exception e) {
                        LOG.error("CMSLogic >>> saveOrUpdate() - threw exception: " + e);
              return flag;
         }Further, here is the code that fetches the data from the DB:
         public static Item getItemByURL ( String url ) {
              // Verify the URL
              if ( url.charAt(0) == '/' ) url = url.substring (1);
              String [] urlArr = url.split( "/" );
              LOG.info("BusinessLogic >>> getItemByURL() - split url: urlArr.length: " + urlArr.length );
              for ( int i = 0; i < urlArr.length; i++ )
                   System.out.println ( urlArr[i] + ", " );
              if ( urlArr == null ) return null;
              if ( urlArr.length == 0 ) return null;
              if ( urlArr.length > 4 ) return null; // If the path depth is more than 3 levels, abort
              // Fetch data from DB
              List<Item> items = null;
              Session session = null;
              Query query = null;
              try {
                   session = sessionFactory.openSession();
                   if ( urlArr.length == 1 ) {
                        query = session.createQuery(
                             "FROM Item WHERE section.sectionKey LIKE 'root' " +
                             "AND filename LIKE '" + urlArr[0] + "'" );
                   else if ( urlArr.length == 2 ) {
                        query = session.createQuery(
                             "FROM Item WHERE section.sectionKey LIKE '" + urlArr[0] + "' " +
                             "AND filename LIKE '" + urlArr[1] + "'" );
                   else if ( urlArr.length == 3 ) {
                        query = session.createQuery(
                             "FROM Item WHERE section.sectionKey LIKE '" + urlArr[1] + "' " +
                             "AND section.parentSection.sectionKey LIKE '" + urlArr[0] + "' " +
                             "AND filename LIKE '" + urlArr[2] + "'" );
                   else { // if ( urlArr.length == 4 ) {
                        query = session.createQuery(
                             "FROM Item WHERE section.sectionKey LIKE '" + urlArr[2] + "' " +
                             "AND section.parentSection.sectionKey LIKE '" + urlArr[1] + "' " +
                             "AND section.parentSection.parentSection.sectionKey LIKE '" + urlArr[0] + "' " +
                             "AND filename LIKE '" + urlArr[3] + "'" );
                   items = query.list();
                   LOG.info("BusinessLogic >>> getItemByURL() - items = query.list(): " + items );
                   // Load the related revisions, too
                   if ( !items.isEmpty() ) {
                        Hibernate.initialize ( items.get(0).getRevisions() );
                        LOG.info("BusinessLogic >>> getItemByURL() - initialised revisions for item." );
                        Hibernate.initialize ( items.get(0).getRevisions().get(0).getTemplate() );
                        LOG.info("BusinessLogic >>> getItemByURL() - initialised template for first revision." );
                   // Flush the session
                   if ( session!= null )
                        session.flush();
              } catch ( Exception e ) {
                   e.printStackTrace ();
                   LOG.error("BusinessLogic >>> getItemByURL() - threw exception: " + e );
              } finally {
                   session.close();
                   //sessionFactory.close(); // !!!???
              // Return query results
              if ( items == null ) return null;
              else if ( items.isEmpty() == true ) return null;
              else {
                   LOG.info("BusinessLogic >>> getItemByURL() - items.get(0).getRevisions().size(): " + items.get(0).getRevisions().size() );
                   LOG.info("BusinessLogic >>> getItemByURL() - items.get(0).getRevisions().get(0): " + items.get(0).getRevisions().get(0) );
                   return items.get(0);
         }Any constructive suggestions and helpful comments are more than welcome.
    I have been struggling with this problem for a while now.
    Anders

  • Problem with SQL space and quotes

    Hi all,
    We have some old generated java code which includes sql statements like:
    select count ("ID") from SUBSCRIBER;
    In our production database (10.2.0.2) this SQL works. In our test database (which is also 10.2.0.2), this SQL causes ORA-00942: table or view does not exist error. However, on the same test database, the following variations work:
    SELECT count ("ID") from SUBSCRIBER;
    select count (ID) from SUBSCRIBER;
    select count("ID") from SUBSCRIBER;
    I cannot change the original java code and I must configure our test database to execute the same SQL. I suspect this behaviour is caused by some oracle init parameters (maybe the "compatible" parameter?). Does anybody have any idea how this problem can be solved?
    Best regards,
    SerkanC

    Table or View does not exist means that the user who is running your query can not see the table.
    The problem is that your user does not have appropriate privileges. If you don't specify the schema_name, you are relying on a synonym existing.
    Finally, some "Bright Spark" may have created the table using double quotes with the table_name not being entirely in uppercase.
    P.S. If your code was in a procedure you would find this error at compile time.
    So:
    i) find out which user is running the java code
    ii) connect as that user in sqlplus and issue the same statement
    You should get an error.
    Determine if a private or public synonym exists (all_synonyms data dictionary view).
    This has nothing to do with compatibility.

  • Problems with USB connection and PC Suite

    Connecting your device to the PC via USB doesn´t always work as smooth as it should. You can either use the setup´s repair function or if you are experiencing more serious problems, you need to uninstall all Nokia software form your phone and get it back on to make to work again. 
    This is how you do it:
    Run the Nokia PC Suite setup file again and choose "repair" instead of "uninstall". This should solve some of the connectivity problems. If it didn´t work for you continue with the instructions below.
    Go to Start --> Settings --> Control Panel --> Software, there you need to uninstall all Nokia software (Nokia PC Suite, Nokia Cable driver, PC Connectivity Solution ...)
    Download and run Nokia PC Suite Cleaner
    Reboot your computer
    Download and install PC Suite here.
    Connect your phone via USB cable (if possible use a different USB jack) and follow the instructions on the screen.
    Now you´re set up to manage your phone with PC Suite!
    For further questions ask within the board, for improvements on this article contact me.
    Thanks to users scoobyman, cricfancy and shuntfield for their collaboration.
    Message Edited by illinjah on 16-Aug-2009 07:02 PM
    By clicking the "Kudos!" or the "Solution?" button on the right you can say "Thank You" and you´ll show the author and others that the post is useful.
    The day we stop improving is the day we stop being good.

    Hi pudu
    thanks for the reply!
    so sad, that doesn't work for me. the same with Nokia_PC_Suite_6_84_10_3_eng_us_web.exe
    I have widcomm stack for bluetooth, there are lot of concerns about this,
    but I do not understand why it cannot be connected via USB, too. Oh, no, it is connected, but that makes no sense

  • Problem with SQL Agent and Maintenance Job

    Heloo All!
    We planned to create maintenance job for daily backup database. But we got a error when we trying to create maintenance job, error -
    An OLE DB error 0x80004005 ( Client unable to establish connection) occured while enumerating packages. A SQL statement was issued and failed).
    Did anybody solve this problem? 
    Also we founded that SQL Server Agent status - stopped. 
    I trying to start Agent, and got error:
    TITLE: Microsoft SQL Server Management Studio
    Unable to start service SQLAGENT$server_name on server server_name. (mscorlib)
    ADDITIONAL INFORMATION:
    The SQLAGENT$server_name  service on server_name started and then stopped. (ObjectExplorer)
    If anybody solve this problems, please request me!
    Thanks, in advance!
    Best regards,
    Ravil!

    All replies 
    Thanks for links
    I started Agent by your first link. But after starting Agent service, service stops immediately. 
    And after restarting service i got this error:
    The SQL Server Agent service on Local Computer started and then stopped. Some Services stop automatically if they 
    are not in use by other services or programs.
    Olaf Helper
    We are using MSSQL 2008 R2 Standart Edition x64
    OS - Windows Server 2008 R2 x64

  • Problem with the connection and synch

    well i have problems since the first day i buy it... i'm really mad about this thing i waste lot of money, where i live ipod is a spensive object and i cant go to eny store becos i buy it to a friend who bring it from eeuu, anyway my problem is this... i conect my ipod to the pc, it synch, but just for a min when suddenly stop and the itunes turn off the dispositive... i have to plug it again to do everything but everytime happen the same thing
    can somebody help me pls? sorry my bad english

    Try this -
    When you device is POWERED ON, remove the battery for a minute, and then reinsert the battery. This make a reboot to your device which resolves minor issues with the BlackBerry device.
    And then try connecting Wi-Fi or Bluetooth.
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • Problem with Socket Connection and Out of Memory Exception in JavaME

    Hi,
    I am working on creating an application to check pop3 emails and send emails using smtp. I have implemented almost everything. It works fine if I run it with debugger [Step by step] but it fails when I run the application on emulator. It never connects to the pop3 server and runs out of memeory.
    Help me on this issue.
    Tarpinder

    HI,
    THanks for the reply..AM using workshop IDE and have tried the "clean" option also but of no use..Is there any other alternative to get rid of this exception ???
    Regards

  • Problem with SQL*Loader and different date formats in the same file

    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    System: AIX 5.3.0.0
    Hello,
    I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
    ...;2010-12-31;22/11/1932;...
    I load this data using the following lines in the control file:
    EXECUTIONDATE1     TIMESTAMP     NULLIF EXECUTIONDATE1=BLANKS     "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
    DELDOB          TIMESTAMP     NULLIF DELDOB=BLANKS          "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
    The relevant NLS parameters:
    NLS_LANGUAGE=FRENCH
    NLS_DATE_FORMAT=DD/MM/RR
    NLS_DATE_LANGUAGE=FRENCH
    If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
    How can I get both date values to load correctly?
    Thanks!
    Sylvain

    This is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(

  • Problem with SQL connection

    Is this the appropriate section to post SQL Database connection problems when using the Java language?
    thank you

    I like this term, too!
    It's so...classic...don't know..
    But well, thanks for the help! It helped me in building my own game site script!
    Best Regards,
    Luiz Soares. [About Me|http://luizjogos.com/cat/1/Jogos-de-Carros/p1.htm]
    Edited by: LuizJogos on Apr 22, 2009 10:00 PM

  • Problems with SQL*Loader and java Runtime

    Hi. I'm trying to start SQL*Loader on Oracle 8 by using Runtime class in this way:
    try{
    Process p = Runtime.getRuntime().exec( "c:\oracle\ora81\bin\sqlldr.exe parfile=c:\parfile\carica.par" );
    /*If i insert this line my application never stops*/
    p.waitFor();
    }catch( Exception e ){
    . I have seen that if lines to insert are less then 400 all works very fine, but if lines number is greater than 400, all data go in my tables but my log file is opened always in writing.Can anyone tell me why?
    Thanks

    Just a note if the executable "sqlldr.exe" does not stop (quit running) by itself the p.waitFor() will wait for ever.

  • Every time I try and update my iphone 4 to ios 7.1 in iTunes 11.1.5 it says "connection reset" even when there is no problem with my connection

    I have an iPhone 4. I use iTunes 11.1.5 on my Mac. I am trying to update to ios 7.1 through iTunes, but every time I do that, I get a "connection reset" error, even when I know there has been no problem with my connection.
    The exact error message is as follows:
    "There was a problem downloading the software for the iPhone "Anne's iPhone". The network connection was reset.
    Make sure your network settings are correct and your network connection is active, or try again later."
    I have checked several times. There is no problem with the connection, and I have tried to download the software several times today.
    Any help you can give me would be appreciated.

    Just managed to successfully download the update, having retried five or six times. I did unplug my phone while the download was taking place (had asked iTunes to download only, not to update) -- suspect this had no bearing on it whatsoever, and that persistence is the only way here.

Maybe you are looking for

  • My dream CS5; just a though.

    I just read the archive forum on "My Dream CS5" and it was quite full of replies, so I decided to ask a couple of questions, OK ? It is taking me a long time to get them all sorted out but now that I am getting better acquainted I can't imagine using

  • Will I need to set up an iTunes account again?

    HI, my name is Saira and ma'am currently unsure as to whether or not I will need to install and setup iTunes since again. I bought an ipad mini 2 years Argo and I got the stop from which I bought it from to do the settings for me. So they basically i

  • Oracle10g dbca does not create "create db" scripts!

    Hi All, Is this a new move in dbca world? What I have noticed is that dbca for 10g creates the template but does not create db creattion scripts under $ORACLE_BASE/{DB_NAME}/create. I think it was pretty useful when the system is limited in RAM and y

  • OIF SP errors when the mapped nameid is "NULL"

    I have an OVD adapter that joins a Database that has the following key columns uid=security_code cn=individual_id ssoid=sso_code all the above columns will be in headers as Header vars. In the case if the UID(security_code) is NULL then the federatio

  • ITunes could not connect to iTunes store

    When trying to sign in with my Apple ID I get iTunes cannot connect to the store, Make sure my network connection is active (-3212). Any help?