MySQL/JDeveloper JDBC - Losing Connection

I am working on a Java Web Application project using JDeveloper (9.0.5.1 Build 1605) while connecting to a mySQL database (4.0.18-max-nt). My application works fine up a certain number of connection. After that, I receive the following error message:
-<snip>-
java.sql.SQLException: Unable to connect to any hosts due to exception: java.lang.NullPointerException
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1719)
at com.mysql.jdbc.Connection.<init>(Connection.java:432)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at model.NodeSummary.makeConnection(NodeSummary.java:229)
at model.NodeSummary.getIDs(NodeSummary.java:391)
-<snip>-
Based on some testing I've done, I can make up to a certain number of connections, than the next one fails. I've searched the web and it appears others have had this same problem. One person fixed the problem by switching to Tomcat.
Is there a solution to this? Do I also have to switch to Tomcat?
Thanks,
Mark

I'd check the bug reports for the mysql jdbc driver to see if this is a known issue, if not send them a bug report, it sounds like one.
Rob
Team JDev

Similar Messages

  • Can't connect a servlet to a mysql database (jdbc)

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class LoginServletJDBC extends HttpServlet{
         public void doGet(HttpServletRequest request,HttpServletResponse response)
         throws ServletException,IOException{
              sendLoginForm(response,false);     }
         public void sendLoginForm(HttpServletResponse response,boolean error)
         throws ServletException,IOException{
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<html><head>");
              out.println("<title>Login</title>");
              out.println("</head>");
              out.println("<body>");
              out.println("<center>");
              if(error)
                   out.println("<b>Failed login. Please try again</b>");
              out.println("<br><br>");
              out.println("<h2>Login page</h2>");
              out.println("<br>Please enter your username and password");
              out.println("<br><br>");
              out.println("<form method=post>");
              out.println("<table>");
              out.println("<tr>");
              out.println("<td>Username : </td>");
              out.println("<td><input type=text name=userName></td>");
              out.println("</tr>");
              out.println("<tr>");
              out.println("<td>Password : </td>");
              out.println("<td><input type=password name=password></td>");
              out.println("</tr>");
              out.println("<tr>");
              out.println("<td align=right colspan=3>");
              out.println("<input type=submit value=Login></td>");
              out.println("</tr>");
              out.println("</table>");
              out.println("</form>");
              out.println("</center>");
              out.println("</body></html>");
    public void doPost(HttpServletRequest request,HttpServletResponse response)
         throws ServletException,IOException{
              String userName = request.getParameter("userName");
              String password = request.getParameter("password");
              if(login(userName,password)){
                   RequestDispatcher rd = request.getRequestDispatcher("AnotherServlet");
                   rd.forward(request,response);
              else{
                   sendLoginForm(response,true);
         boolean login(String userName,String password){
              try{
                   String url = "jdbc:mysql://localhost:3306/Users";
                   Class.forName("com.mysql.jdbc.Driver");
                   Connection con = DriverManager.getConnection(url,"root","");
                   //System.out.println("got connection");
                   Statement s = con.createStatement();
                   String sql = "select userName from Users where userName='"+userName+"and password='"+password+"';";
                   ResultSet rs = s.executeQuery(sql);
                   if(rs.next()){
                        rs.close();
                        s.close();
                        con.close();
                        return true;
                   rs.close();
                   s.close();
                   con.close();
              catch(ClassNotFoundException e){
                   System.out.println(e.toString());
              catch(SQLException e){
                   System.out.println(e.toString());
              catch(Exception e){
                   System.out.println(e.toString());
              return false;
    }so ...
    here i'm trying to connect to Users mysql database (i use Tomcat 4.1 and mysql servers and clients 4.0.1-alpha)
    where is the problem ? when i run this servlet (http://localhost:8080/example/servlet/LoginServletJDBC ) it works ;
    BUT when i type an username and a password (any user&pass) my servlet doesn't connect to the database (become a infinite loop without output ; i mean no any errors and exceptions)
    i try other think : i changed the database with unexisting database and the result was that i was expected (Unknow database 'unexistingdatabase' )
    what i miss ?
    please... can anyone help me...
    thank`s in advance

    The wireless security setting that the Actiontec modem/router is using may be different...and not compatible....than the setting that the Comcast product was using.
    If you think that might the case, and you have the time to troubleshoot......
    Temporarily, turn off the wireless security on the Actiontec modem/router
    Reset an AirPort Express back to default settings, then see if it will connect using no security and allow an Internet connection when you do the Ethernet port test in the post above again.
    If the AirPort Express cannot connect correctly using no security on the wireless network.....then it is a no brainer to know that it will never connect when security is enabled.  So, if the AirPort will not connect using no security, you may have an incompatibility issue between the Actiontec and Apple products.
    However, if the AirPort Express connects OK with no security, then this tells you that you will need to use a different setting for security on the Actiontec...the same that the Comcast router was using before.....so the Express will have a better chance of connecting.
    That setting would be something like WPA/WPA2 Personal, or the same setting stated another way would be WPA-PSK-TKIP.

  • How to close JDBC client connections in JSP (9IDS Jdeveloper)

    Can anyone tell me how to close JDBC connections neatly through JSP in Oracle 9IDS Jdeveloper.
    I have a developer who has deployed a WAR file (comprising JSP page) to the Tomcat webserver.
    The page works fine except that it always leaves a JDBC client connection after the user closes the internet explorer window.
    I've tried using dead connection detection without success.
    At the operating system level, I have a script that can kill these sessions but I would prefer if theres some way the connection can be closed neatly through the JSP application.

    Hi:
    At database level you can:
    See CONNECT_TIME and IDLE_TIME options to CREATE/ALTER PROFILE
    Joao

  • Connecting to MySQL with JDBC in Reports

    Hi,
    I need help connecting to a MySQL db through oracle reports using a jdbc connection.
    I have downloaded the MySQL JDBC driver:mysql-connector-java-3.0.17-ga-bin.jar.
    I can succesfully use it to connect if I write a simple java program. So I know the driver works.
    I have set it in my classpath & edited the jdbcpds.conf file by adding the following:
    <driver name = "mysql-merant"
    sourceDatabase = "other"
    subProtocol = "mysql"
    connectString = "mainProtocol:subProtocol://databaseName"
    class = "com.mysql.jdbc.Driver"
    connection = "oracle.reports.plugin.datasource.jdbcpds.JDBCConnectionHandling">
    </driver>
    When I try to connect, I get the following error, ERR 62002 failed to connect to the data source.
    What do I have to do to connect? Is there a way to directly give the connect string?
    I can connect to an oracle DB using a the Oracle drivers no problem, why does forms not accept the MySQL driver? What can I do to make this work?
    Any help would be appreciated.
    Michael Baran
    [email protected]

    Michael,
    there is a Reports forum here on OTN as well. Posting your question there might be a better chance.
    Frank

  • How can I remove the JDBC (JDNI) Connection Information prompt?

    Hi everyone,
    I'm using Crystal Reports 2008 and a JDBC connector to a MySQL database.
    My reports work well, but I'm always prompted to enter the database password in the JDBC (JDNI) Connection Information window prompt. The other fields (server, database, user ID) are automatically populated, but I have to enter the password.
    Is there anyway for me to bypass this prompt altogether? Or, can I manually hard code the database password somewhere?
    Thank you!

    Hi Rachel,
    You can't get around this unless the driver supports Trusted Authentication which uses the local user log on credentials. It's just the way it works. Crystal will not and never has saved the database password and never will. This would be a major security issue. Anyone could get your report and have full access to the DB.
    Thank you
    Don

  • Windows 8 keeps losing connectivity

    Hi, not sure if this is unique but for the past few weeks Windows 8 has been losing connectivity every few minutes when browsing web pages, playing games etc. I am sure it's windows 8 as I have another work laptop using XP that I can be on all day via a
    VPN and that does not drop at all (it would normally drop within a few seconds of losing connectivity). I've done a lot of searching on the net for the same issue, others seem to be having similar things happen such as slow speed but can't find anything that
    matches, hence this separate question.
    I have also tried swapping routers to no avail. The thing is, you wouldn't know anything had happened from the network connectivity. Suddenly a page won't load. The wireless connectivity at the bottom right of the screen shows a full 5 bars (not limited
    connectivity). The way to get it back again is to leave it for a few minutes or disconnect from the router and reconnect again. Even whilst typing this I have had to do that twice.
    I'd appreciate some suggestions!
    Many Thanks, Paul.
    PS... IPCONFIG/ALL shows...
    Microsoft Windows [Version 6.2.9200]
    (c) 2012 Microsoft Corporation. All rights reserved.
    Wireless LAN adapter Local Area Connection* 17:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft Hosted Network Virtual Adapter
    #3
       Physical Address. . . . . . . . . : 56-DE-2B-64-0B-25
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
    Wireless LAN adapter WiFi 2:
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Qualcomm Atheros AR5B125 Wireless Network
     Adapter
       Physical Address. . . . . . . . . : 74-DE-2B-64-0B-25
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       IPv4 Address. . . . . . . . . . . : 192.168.0.4(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : 11 May 2013 10:31:15
       Lease Expires . . . . . . . . . . : 12 May 2013 10:31:21
       Default Gateway . . . . . . . . . : 192.168.0.1
       DHCP Server . . . . . . . . . . . : 192.168.0.1
       DNS Servers . . . . . . . . . . . : 194.168.4.100
                                           194.168.8.100
       NetBIOS over Tcpip. . . . . . . . : Enabled
    Ethernet adapter Local Area Connection:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Broadcom NetLink (TM) Ethernet
       Physical Address. . . . . . . . . : DC-0E-A1-07-A8-F0
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
    Tunnel adapter isatap.{A319BEA5-A55C-4E0C-AF67-922BEBD4C7BB}:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft ISATAP Adapter
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    Tunnel adapter Local Area Connection* 13:
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       IPv6 Address. . . . . . . . . . . : 2001:0:9d38:953c:3483:1732:adda:66e3(Pref
    erred)
       Link-local IPv6 Address . . . . . : fe80::3483:1732:adda:66e3%14(Preferred)
       Default Gateway . . . . . . . . . : ::
       DHCPv6 IAID . . . . . . . . . . . : 436207616
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-16-28-39-CC-DC-0E-A1-07-A8-F0
       NetBIOS over Tcpip. . . . . . . . : Disabled

    Hi,
    Does this issue occur with both wireless and wired?
    I suggest to perform these tests to troubleshoot the issue:
    1 Update NIC card for your machine
    2 Temporary disable firewall and antivirus program
    3 Logon with Safe Mode with Networking
    4 Update framework for your router.
    Leo Huang
    TechNet Community Support

  • Been losing connection for magic mouse and wireless keyboard

    When I have my MBP running Mavericks in clamshell mode, I lose connections to both magic mouse and apple wireless keyboard in clamshell mode. I've tried all the PRAM SCM, aluminum foil and paper tricks. What I then did was test what happens when I leave the MBP open rather than in clamshell mode and it appears to avoid losing connection, at least that is what I've concluded with Mavericks for now..... anyone else able to replicate this? Having to leave the MBP open is not ideal.

    Barry, thanks, still not working.  I've tried every thing I can think of or have read, what I'm concluding is that there is either a problem with Mavericks or something has changed on how bluetooth works in Mavericks. Did not have this problem for the last 4 years. I can reproduce the problem when I close the laptop. I had the Bluetooth and wireless card checked out and replaced about 3 weeks ago. Problem has continued.

  • JDeveloper fails to connect after enabling SSL Listen Port

    Hi,
    When I activate SSL on port 8002 (SSL Listen Port Enabled) for my soa_server in weblogic console, JDeveloper fails to connect to the server when deploying.
    Soa server lookup takes a long time an ends in an error failed to connect to <server>:8002
    When I turn off SSL JDev can find the SOA server again.
    I use JDeveloper 11.1.1.4 and SOA Suite 11.1.1.4
    What can I do about this?
    Groeten,
    HJH

    Here's the top 3 causes for this:
    (1) make sure the database listener is running on the server with the database.
    (2) make sure the connection information that JDeveloper is using is correct.
    (3) remember that JDeveloper uses the SID and not the service name.
    Rob
    Team JDev

  • External drive conntected to Time Capsule keeps losing connection

    I've been having this problem since I bought my TC over one year ago. Other than this everything works fine (aside from the occasional need for a restart).
    I have an external 500GB drive attached to my 500GB TC via usb. I use the TC strictly for backups and the other drive to host my media files. When I want to use those files I switch on the drive. Only about half of the time does that work. When it does work everything is fine. I see the drive in the finder as expected.
    When it doesn't work, I can see the drive name in the finder. But if I click to go into the folder, I get an error saying that the connection cannot be found.
    It shows up in the Airport Utility as normal.
    Powering the drive off and on does not help.
    Relaunching the finder doesn't help either.
    The only way I can connect to the drive again is to either logoff and log back into my mac, or restart the TC.
    It seems that my computer is remembering some kind of network disk mounting settings that don't get refreshed when I turn on the drive, but then do get refreshed when I logoff and back in. Does anyone know how I could force that refresh to happen? Has anyone had this problem before?
    Any suggestions would be much appreciated
    PS all my software and firmware are the latest.
    Thanks.

    OS X fan
    This helped meRe: Time Capsule keeps losing connection in Finder 
    Dec 17, 2013 4:08 AM (in response to whootang12)
    Left click on the Finder icon from the Dock and click "Connect to server...", go to recent server and click on your Airport Time Capsule.
    THANK YOU!!!!
    This solved it for me!

  • Network Drives Losing Connection from Server 2012 to Windows 7 64bit Machines

    I have about 20 users at my facility and recently upgraded our server from one running server 2003 to one running server 2012. Since that occurred, I have had numerous issues that I did not encounter on the old server.
    Lately, users have been losing connection to the shared network drives randomly and constantly. The drives will come back on-line on their own but it could be 2 minutes or 30 minutes before they do and when users are in the middle of working on a document
    from the network, they are unable to save until the drive comes back. Manually disconnecting and re-mapping them works sometimes but then the problem will re-occur. I have tried re-doing the shares and security settings and run a couple of supposed hotfixes
    on the client side and the server side to no avail.
    Now our regional office is suggesting that I re-connect the old server and then rebuild the new one with server 2008 r2, something I would like to avoid if possible.
    I feel like this is a simple setting that I am missing, no conditions have changed except for the new server.
    The server is a Intel Xeon CPU E5-2609 2.40GHz with Server 2012 64 bit on it. All computers (except on on 32 bit) are running Windows 7 Enterprise edition 64 bit.
    Please help.

    I made this change to the registry on the server and am waiting to see if I have any more drops.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
    Value:
    autodisconnect
    Data
    type : REG_DWORD
    Value:
    ffff (Hex)
    There was a client side change suggested but I am missing that value for the client side change and others in the organization who don't have it are not experiencing this problem.

  • LaCie external hard drive keeps losing connection to Windows 8.1 computer

    Hello all,
    My LaCie external hard drive (Rugged version) seems like it keeps losing connection to my brand new Windows 8.1 laptop. The laptop is an HP Pavillion 15-p 133cl TouchSmart Notebook which I just got today. Basically, every few minutes, or if I nudge the external
    a bit, the computer will seem like it disconnected and reconnected to the external hard drive in a split second and bring it up in the Windows Explorer. This external hard drive doesn't show any problems connecting to any other computer, but it has occurred
    with 2/3 ports on this computer so far. I'm a bit worried, because I definitely DO NOT want the files on this external to get corrupted in any way. What should I do? Thanks a bunch.

    may I know your external HDD model, to check which USB version to isolate power and cable connection issue 
    if this is USB 3.0 try to attached at USB 3.0 at your laptop, your laptop has 2 USB 3.0 and 1 for 2.0, for external HDD with USB 2.0 sometimes need more power / more than 1 connection, sometimes the power will loose
    but since the trigger it will disconnect if you nudge the HDD, I suggest back up data to your laptop first, try to change with other data or power cable, try also update your laptop chipset
    try to check with other device to isolate port issue
    may I know if you are using other PC, did your external HDD also will disconnect if you nudge it?
    contact your external HDD manufactured to get some suggestion   

  • How to use JDBC database connection in Solaris

    Hi all,
    I am new to Solaris and i want to create an application using JDBC database connection.
    I want a small piece of code, probably a login page code that verifies the username from a OpenOffice database (.odb) file. I am particular to know the driver name, etc. If possible give the code using JNDI loopkup.
    Thanks in advance,
    Parasou.

    Sure no problem.
    Please stand by while I do your work for you.

  • Questions About Losing Connection

    Like other people I've noticed here, my WRTG45 v5 wireless router has recently started losing connection to the net multiple times a day. At first, we thought it was because our modem was old, so we bought a new one, but it didn't fix anything. So here are my questions:
    1. My dad seems to think that a configuration or setup CD (that we lost) is required to make the router work with the new modem. Is this true? I don't think so, but I have to ask just so I can get him to move on.
    2. I noticed in other posts here that programs like Bittorrent can cause the router to be overworked or whatever. This might explain our problem, as I use Bittorrent a lot (but not everytime the connection has dropped). If this is indeed the problem (or contributing to it), is there anyway to deal with it while still being able to use the program?
    For the first couple months, the router was working fine. Even with Bittorrent running a lot, and all the computers (2 wired, 1 wireless, and 1 wired X-Box) engaging in various activities on the net. So this is very puzzling to me.
    One more bit of information, I have given every computer a unique, static IP address. However, I noticed recently that when I look at the router configution after typing in its IP address in a web browser, that it is set to DHCP Enabled.
    Also, in the advanced TCP/IP settings for this connection, under the WNS tab, the NetBIOS setting is set to the default of using NetBIOS from the DCHP server.
    Since I am using static IP addresses, could these DHCP centered settings be causing problems? Although, even if they are, it still doesn't explain why the router was working fine months ago (unless someone changed stuff without my knowing).
    Anyway, any help at all would be appreciated.

    I assume you meant that you had a WRT54G v5 router.
    First of all, the setup CD is not required.  All router settings can be made by going to the router's web pages at 192.168.1.1
    It is possible that the static LAN IP addresses are causing your problem, if they were not set up correctly.  Linksys has a strict set of rules to follow regarding static LAN IP addresses.
    With Linksys routers, a fixed (static) LAN IP addresses must be assigned in the device that is using the address.  So you need to enter the fixed address in the computer or printer, not in the router.
    When using a Linksys router, any fixed LAN IP address must be outside the DHCP server range (typically 192.168.1.100 thru 192.168.1.149), and it cannot end in 0, 1,  or 255.
    Therefore any fixed LAN IP address would normally need to be in the range of
    192.168.1.2       thru 192.168.1.99  or
    192.168.1.150   thru 192.168.1.254
    assuming you are still using the default DHCP server range.
    Also, in the computer, when you set up a static LAN IP address, you would need to set the "Subnet mask" to 255.255.255.0  and the "Default Gateway" to 192.168.1.1
    It is also important that no two devices on your network be set to the same static LAN IP address.
    Check all of your static LAN IP addresses.  If you have violated any of the above rules for static LAN IP addresses, it could be the cause for your problem, and you should fix it before attempting any other router repairs or changes.
    You should leave the DHCP server turned on.  This way, if you have a visiting friend who you want to connect to your system, it will be easy to do.   Leaving the DHCP server turned on should not cause any problems, even if all your addresses are fixed.   In general, you should let the DHCP server assign all addresses, unless there is a specific reason to use a static address.  You can mix static and DHCP assigned addresses on the same LAN, as long as you follow the above rules for static addresses.
    Linksys routers have had problems when BitTorrent is used.  Your router has new firmware posted that should improve compatibility with BitTorrent.  It is firmware version 1.02.0   You will need to download and install this firmware (after fixing the static address problem, if any).  (Note:  When you update your firmware, you should use a computer that is wired to the router.  Also, when you do a firmware upgrade, turn off all other computers on your system, and unplug all other wires from the router.)   After you have installed the firmware, and powercycled the router, you will need to reset your router to factory defaults, then setup the router again from scratch.
    Message Edited by toomanydonuts on 04-12-200712:54 AM

  • CR4E - New JDBC (JNDI) connection at runtime

    Is it possible to create a new JDBC (JNDI) connection at runtime using the propertyBag to set the attributes?  I tried this but received error message stating "error finding jndi name".

    Are you specifying a JDBC or JNDI connection?
    If JDBC, did you set the (Optional) JNDI Connection property?
    If you set the JNDI property for the JDBC connection, it'll try connecting to the JNDI.
    The JDBC has the optional JNDI property, so that you can design a report against JDBC, then use the JNDI when deployed to a J2EE.
    Sincerely,
    Ted Ueda

  • "jdbc:mysql:///test" - "jdbc:mysql:test" what is the difference

    "jdbc:mysql:///test" -> "jdbc:mysql:test" what is the difference:
    I used both of them in my url but only "jdbc:mysql:///test" worked only
    what is the difference what /// means?

    JDBC URLs have the format
    jdbc:<subprotocol>://<data source identifier>
    jdbc indicates a JDBC data source. subprotocol identifies which JDBC Driver to use.
    For com.mysql.jdbc.Driver and localhost server, database name as 'test':
    it's jdbc:mysql://localhost/test
    or jdbc:mysql://127.0.0.1:3306/test
    you would select another server and database name.
    For sun.jdbc.odbc.JdbcOdbcDriver with MS Access or SQLServer database, it's jdbc:odbc:DSNname
    HTH

Maybe you are looking for