Why JApplet and JSP cannot connect to MySQL

When i use applet connect to MySQL, it show that no suitable driver.
My program is
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
public class fuck extends JApplet implements ActionListener
private JButton bb = new JButton("update");
private JTextArea aa = new JTextArea(1,7);
private JTextArea ss = new JTextArea(1,7);
private JPanel pp = new JPanel();
public fuck()
Container c=getContentPane();
pp.add(aa);
pp.add(ss);
pp.add(bb);
c.add(pp);
bb.addActionListener(this);
public void actionPerformed(ActionEvent ee)
try
Class.forName("org.gjt.mm.mysql.Driver");
catch(ClassNotFoundException e)
System.out.println(e.getMessage());
try
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost/air","root","");
Statement st = con.createStatement();
//PreparedStatement pst = con.prepareStatement(
// "update aa set condition=? where temp=?");
//pst.setInt(1,3);
//pst.setString(2,"hg");
//pst.executeUpdate();
ResultSet rs=
st.executeQuery("select * from aa");
while (rs.next())
aa.setText(rs.getString("temp"));
ss.setText(rs.getString("condition"));
st.close();
con.close();
catch(SQLException ex)
System.err.println("SQLException:"+ex.getMessage());
If I using JSP, it also have some condition

Clearly it is in the classpath, otherwise the error would have been "Class not found". But here's a quote from the documentation for the driver, the part that explains how to make a connection:// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("org.gjt.mm.mysql.Driver").newInstance();The "broken Java implementations" it refers to are certain JVMs that run applets in browsers...

Similar Messages

  • Why do I get "Cannot connect to ITunes Store" message on my IPad and IPhone?

    Why do I get "Cannot connect to ITunes Store" message on my IPad and IPhone?
    I have tried numerous times to connect to ITunes Store to update my current apps and continue to get this message.  Apple has determined that it is not a device problem or an Apple problem.  It has to do with ITunes.  Can anyone help?

    I am having no problems downloading from the app store today. I just tried it again. However, I read some of those other discussions as well and there have been times when the iTunes or App Store has been out of commission. Don't hold your breath waiting for Apple to acknowledge it because that is not going to happen. That is not how they operate.
    You can report it to them here ....
    http://www.apple.com/support/itunes/contact/

  • TS2756 iam using iphone 4S with win 7 PC and i cannot connect to the internet through my phone but i tried with my other 4S and it works but what should i do for the first iphone 4S???

    iam using iphone 4S with win 7 PC and i cannot connect to the internet through my phone but i tried with my other 4S and it works but what should i do for the first iphone 4S???
    as i said i have two iphone 4S,,,,,
    1st one --- has os 5.1
    2nd one has os 6.0
    i tried 2nd one with carrier reliance gsm nd it works with that personal hotspot setting using USB...
    but i want to connect the first 4S with carrier TATA DOCOMO GSM but its not working with the same USB feature????
    plz reply asap...!!!
    thnxxx in advance!!!

    If not this:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    One user reported that placing the iPod in the freezer fixed the problem.
    Also heating sometimes works. See:
    Why can't I select my wifi settings?
    A trick that works frequently with iPhones:
    Settings > AirPlane Mode ON, Do Not Disturb ON
    Power down and wait 5-10 minutes
    Power up
    Settings > AirPlane Mode OFF, Do Not Disturb OFF
    If not successful, an appointment at the Genius Bar of an Apple store is usually in order.
    Apple Retail Store - Genius Bar
    Then:
    Does the iOS device connect to other networks? See other networks? If yes that tends to indicate a problem with your network.
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    .- Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network      
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem and it does not connect to any networks make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • Why LAP1131AG and LAP11412 cannot to join WLC 2504?

    I have WLC 2504, Cisco LAP1131AG and then Cisco LAP1142N. Why LAP1131AG and LAP11412 cannot to join WLC 2504?
    this is error code at the Cisco LAP1131AG
    *Sep 12 19:30:27.730: %CAPWAP-3-ERRORLOG: Go join a capwap controller 
    *Sep 12 19:30:27.000: %CAPWAP-5-DTLSREQSEND: DTLS connection request sent peer_ip: 192.168.100.10 peer_port: 5246
    *Sep 12 19:30:57.001: DTLS_CLIENT_ERROR: ../capwap/base_capwap/dtls/base_capwap_dtls_connection_db.c:2051 Max retransmission count reached!
    *Sep 12 19:31:27.000: %DTLS-5-SEND_ALERT: Send FATAL : Close notify Alert to 192.168.100.10:5246
    *Sep 12 19:31:32.083: %LINK-5-CHANGED: Interface Dot11Radio0, changed state to administratively down
    *Sep 12 19:31:32.083: %LINK-5-CHANGED: Interface Dot11Radio1, changed state to administratively down
    *Sep 12 19:31:32.085: %LINK-6-UPDOWN: Interface Dot11Radio0, changed state to up
    *Sep 12 19:31:32.117: %CAPWAP-3-ERRORLOG: Not sending discovery request AP does not have an Ip !! 
    *Sep 12 19:31:32.118: %LINK-6-UPDOWN: Interface Dot11Radio1, changed state to up
    *Sep 12 19:31:33.083: %LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio1, changed state to down
    *Sep 12 19:31:33.112: %LINK-6-UPDOWN: Interface Dot11Radio0, changed state to down
    *Sep 12 19:31:33.117: %LINK-5-CHANGED: Interface Dot11Radio0, changed state to reset
    *Sep 12 19:31:34.104: %LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio1, changed state to up
    *Sep 12 19:31:34.111: %LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio0, changed state to down
    *Sep 12 19:31:34.142: %LINK-6-UPDOWN: Interface Dot11Radio0, changed state to up
    *Sep 12 19:31:34.147: %LINK-6-UPDOWN: Interface Dot11Radio1, changed state to down
    *Sep 12 19:31:34.152: %LINK-5-CHANGED: Interface Dot11Radio1, changed state to reset
    *Sep 12 19:31:35.141: %LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio0, changed state to up
    *Sep 12 19:31:35.146: %LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio1, changed state to down
    *Sep 12 19:31:35.170: %LINK-6-UPDOWN: Interface Dot11Radio1, changed state to up
    *Sep 12 19:31:36.171: %LINEPROTO-5-UPDOWN: Line protocol on Interface Dot11Radio1, changed state to up
    this is version LAP1131AG
    AP0018.18fc.fd58#sh version 
    Cisco IOS Software, C1130 Software (C1130-K9W8-M), Version 12.4(25e)JAO6, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2014 by Cisco Systems, Inc.
    Compiled Fri 22-Aug-14 10:07 by prod_rel_team
    ROM: Bootstrap program is C1130 boot loader
    BOOTLDR: C1130 Boot Loader (C1130-BOOT-M) Version 12.3(7)JA1, RELEASE SOFTWARE (fc1)
    AP0018.18fc.fd58 uptime is 9 minutes
    System returned to ROM by power-on
    System image file is "flash:/c1130-k9w8-mx.124-25e.JAO6/c1130-k9w8-mx.124-25e.JAO6"
    and then this is version WLC2504
    (Cisco Controller) >show sysinfo 
    Manufacturer's Name.............................. Cisco Systems Inc.
    Product Name..................................... Cisco Controller
    Product Version.................................. 7.6.130.0
    Bootloader Version............................... 1.0.20
    Field Recovery Image Version..................... 7.6.101.1
    Firmware Version................................. PIC 16.0
    Build Type....................................... DATA + WPS
    System Name...................................... Cisco_47:19:c4
    System Location.................................. 
    System Contact................................... 
    System ObjectID.................................. 1.3.6.1.4.1.9.1.1279
    IP Address....................................... 192.168.100.10
    Last Reset....................................... Software reset
    System Up Time................................... 0 days 0 hrs 36 mins 45 secs
    System Timezone Location......................... 
    System Stats Realtime Interval................... 5
    System Stats Normal Interval..................... 180
    --More-- or (q)uit
    Configured Country............................... ID  - Indonesia
    Operating Environment............................ Commercial (0 to 40 C)
    Internal Temp Alarm Limits....................... 0 to 65 C
    Internal Temperature............................. +34 C
    External Temperature............................. +40 C
    Fan Status....................................... 4100 rpm
    State of 802.11b Network......................... Enabled
    State of 802.11a Network......................... Enabled
    Number of WLANs.................................. 1
    Number of Active Clients......................... 0
    Burned-in MAC Address............................ 24:E9:B3:47:19:C0
    Maximum number of APs supported.................. 5
    IP Address management WLC : 192.168.100.10/24
    IP Address LAP1142N :192.168.100.102/24
    IP Address LAP1131AG : 192.168.100.101/24
    Can anyone help my problem?

    A summary of U.S. laws governing Cisco cryptographic products may be found at:
    http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
    If you require further assistance please contact us by sending email to
    [email protected]
    cisco AIR-LAP1142N-A-K9 (PowerPC405ex) processor (revision A0) with 90102K/40960K bytes of memory.
    Processor board ID FGL1439S15W
    PowerPC405ex CPU at 586MHz, revision number 0x147E
    Last reset from reload
    LWAPP image version 7.6.130.0
    1 Gigabit Ethernet interface
    2 802.11 Radios
    32K bytes of flash-simulated non-volatile configuration memory.
    Base ethernet MAC Address: C8:4C:75:79:EB:E9
    Part Number                          : 73-12836-03
    PCA Assembly Number                  : 800-33767-03
    PCA Revision Number                  : A0
    PCB Serial Number                    : FOC14234D8Z
    Top Assembly Part Number             : 800-33775-02
    Top Assembly Serial Number           : FGL1439S15W
    Top Revision Number                  : A0
    Product/Model Number                 : AIR-LAP1142N-A-K9  
    cisco AIR-LAP1131AG-A-K9 (PowerPCElvis) processor (revision A0) with 27638K/5120K bytes of memory.
    Processor board ID FTX1026T46E
    PowerPCElvis CPU at 262Mhz, revision number 0x0950
    Last reset from power-on
    LWAPP image version 7.6.130.0
    1 FastEthernet interface
    2 802.11 Radio(s)
    32K bytes of flash-simulated non-volatile configuration memory.
    Base ethernet MAC Address: 00:18:18:FC:FD:58
    Part Number                          : 73-8962-09
    PCA Assembly Number                  : 800-24818-08
    PCA Revision Number                  : A0
    PCB Serial Number                    : FOC102513DE
    Top Assembly Part Number             : 800-25544-06
    Top Assembly Serial Number           : FTX1026T46E
    Top Revision Number                  : A0
    Product/Model Number                 : AIR-LAP1131AG-A-K9  
    Configuration register is 0xF

  • Connection to db rejected.Cannot connect to MySQL server

    here is the excaption
    connectToDb:02 - connection to db rejected.Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.BindException)
    and her is the class
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class DBconnect
    {  final static private String _url        = "jdbc:mysql://localhost:3306/diamonds";     //final static private String _driver     = "sun.jdbc.odbc.JdbcOdbcDriver";
        //final static private String _url        = "jdbc:odbc:diamonds";     //final static private String _driver     = "sun.jdbc.odbc.JdbcOdbcDriver";
        public Connection     _con                     = null;
         //private static Driver          driver          = null;
         private static Properties     properties     = null;
         Statement stmt                                 = null;
         public PrintStream     out;
            **connectToDb **
            public void connectToDb()        throws IOException
            //connect to the server and open the database
             try{
                   Class.forName("org.gjt.mm.mysql.Driver");
                   //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   //driver = (Driver)Class.forName (_driver).newInstance();
                   properties = new Properties();
                properties.put("user","sa");
                   properties.put("password","");
            catch (ClassNotFoundException e)
                   System.out.println("class not found:");
                   e.printStackTrace();
              catch (Exception e) {
                        e.printStackTrace();
                 throw new IOException("connectToDb:01- JDBC driver not found."+e.getMessage());
         synchronized void open()throws Exception
              try
                   if(_con == null)
                        try
                             _con = DriverManager.getConnection(_url,properties);
                             //_con = driver.connect(_url,properties);
                        catch (SQLException e)
                             e.printStackTrace();
                             System.out.println("connectToDb:02 - connection to db rejected."+e.getMessage());
                        stmt = _con.createStatement();
              catch (Exception e)
                   e.printStackTrace();
                   System.out.println("connectToDb:02 - connection to db rejected."+e.getMessage());
         synchronized void close()
              try
                   if(_con != null)
                        if(!_con.isClosed())
                             stmt.close();
                             _con.close();
                             _con = null;
              catch (Exception e)
                   System.out.println("es:fail to close connection!!");
    }the problem occars when there are a lot of queries that the project is sending to the DB (about 10000) the last half queries fails and send an excaption .
    after 2 minutes the system seems like working fine.
    I am stack with this problem about a year and cann't resolve it.
    any idea????
    regards
    amnon m

    well...new it seems to work fine, but is it ok to
    keep connection open for good ???
    isn't there any other alternative ???I am bit confused are you pooling the connections?
    If so, actually the connections will not always stay open.. they will time out after a while when they are not in use but to specifically answer your question.. how could it possible be a bad thing. If the server/your app was getting bogged down with opening and closing connections then pooling solves this..
    Finally as to your question of the alternatives... if the problem was opening and closing connections and reusing them through a pool solved this then I think the answer is no. If you don't like a specific part of the way the pool works it is probably configurable in some way and you could always implement your own pool.. although I wouldn't overly recommend that. The bottom line is that you need to keep your connections open for reuse.. pooling is the simplest way to achieve this.. but no there is no alternative to keeping your connections open if you are having the load problems you described.

  • All of my apple sets (iphone, ipad and computer) cannot connect the app store since yesterday, what's wrong with the app store?

    All of my apple sets (iphone, ipad and computer) cannot connect the app store since yesterday, what's wrong with the app store? do you know? or do you have have the same experience?

    I still have access.  Must be your phone or your internet connection.

  • My iTunes playlist page is frozen and I cannot connect with purchase store.  I miss an update download this week and I am not sure if this is needed to fix a bug.  How can I recover this download to update?

    My iTunes playlist page on PC is frozen and I cannot connect to store for purchase.  I missed an iTunes update download this week and I don't know if this would fix a bug.  How can I recover this download to have the latest update.

    It would be best to post this question under iTunes category. I am sure there are a few people having the same type of problem.

  • We have just installed  Lion  and now cannot connect to MyExpat

    we have just installed OS X Lion, v10.7.2  and now cannot connect to MyExpatNetwork on my Macbook pro. Any suggestions?

    yeah-find out where you're downloading stuff to, and stick with it. I'm using FireFox and tell it to save the driver and stuff on the desktop, and when I quit FireFox, there it is on the desktop. you'll also need your admin password. It should show up as a .dmg file, then double-click on it to open it. You should see "Brother.pkg" . start up brother.pkg (double click??) and folow the instructions that ought to appear to install the printer driver.  If the .dmg file doesn't mount, use Disk Utility** to mount it and get it working. Then you should see the package.  and then you can install it.
    ** you may have to click on the .dmg file and choose "Get Info" then Open with, then choose disk utility, and then open with then change all. then close it. Hopefully that ought to work. If you cannot remember your admin password, I can't help you right now. Looks like you'd need it, to let Brother install that printer driver.
    well, enough for tonight
    if this didn't help you, then ask me again tomorrow
    John b

  • HT4628 My Mac Air OSX10.8.5 won't connect to the internet as it says it has a self assigned IP address and thus cannot connect to the internet. I can only connect to a network by manually typing in the configuration specs. Please help.

    My mac air OSX10.8.5 won't connect to the internet. It says it has a 'self assigned IP address and therefore cannot connect to the internet'. Network diagnostics is unable to the solve the problem. It happened suddenly for no reason and now I cannot connect except by typing in the configuration settings manually. Please help me!

    Use the Airport Utility or log into your wireless device via http and ensure the DHCP/NAT service is enabled.  If accessing via HTTP, you will need to manually set an ip within your local subnet (eg: 192.168.0.x).

  • HT201246 what shall i do if i forgot my ipod 5th gen password and i cannot connect it to a computer???????

    what shall i do if i forgot my ipod 5th gen password and i cannot connect it to a computer???????
    ALSO THIS IS THE FIRST TIME SWITCHING ON MY IPOD IN 5 MONTHS

    If no computer:
    Only if:
    If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone and use Remote Wipe to erase the contents of your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode after the device has been erased.
    You can also wipe the iOS device by installing the FindMyiPhone app on another iOS device and using that app to wipe the device.
    Otherwise you need a computer with iTunes and an internet connection
    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Forgot passcode or device disabled
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:                                                             
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes       
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:                         
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

  • TS1368 i try to charge my ipod 4th generation but can not see the battary been charge and also cannot connect to itunes on my computer

    i try to charge my ipod 4th generation but can not see the battary been charge and also cannot connect to itunes on my computer

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • I upgraded to iOS 6.1.3 and now the app store and iTunes "Cannot connect to iTunes Store". Help?

    I upgraded to my iPod Touch to iOS 6.1.3 and now the app store and iTunes "Cannot connect to iTunes Store". Help?

    this will sound odd... but make sure your time zone is set correctly.... SETTING, GENERAL, DATE & TIME and make sure SET AUTOMATICALLY is turned ON... i had a similar problem and this fixed it.... good luck

  • TS1398 I did everything you are recommend to do and still cannot connect to the network. "Unable to join network" shows up even that is a university network working for other users - students and staff. I am very unhappy with my new iphone 5 :(

    I did everything recommended on apple store support site and still cannot connect to the network with my new iphone 5 but my co-workers and students (I work for the university) can keep connectivity all the time. I am very unhappy with my new phone

    Be patient, Apple is coming out with a update soon, its been reported that they have sent the update to the carriers to test, which means it will be soon. And is suppose to address this issue.

  • My ipod touch passcode is locked and i cannot connect to the computer last synced with

    My ipod touch passcode is locked and I cannot connect to the computer last synced with

    Place the iPod in recovery mode and then restore on any computer with iTunes. For recovery mode:
    iPhone and iPod touch: Unable to update or restore

  • I get a message that my ipad and iphone cannot connect to the iTunes store. I have tried to sync books to my iPad and iphone and i get the message that I cannot connect to the iTunes store and thus cannot sync a book to my books app. Why?

    I get a message that my ipad 2 and iphone 5 cannot connect to the itunes store when I try to sync a book to my book app. Although, when I click "store" both are able to access the itunes store. Why is this? Also I tried to open a book that was synced and a message that I did not have enough memory to load this book popped up--when I know that I have well over 40gb of memory left in my ipad and over 16gb left in my iphone. The message that I cannot connect to the itunes store is strange that it offers no option and I have to hit OK to get out and use my ipad or iphone.

    Try logging out of your account on the iPad by tapping on your id in Settings > Store and then log back in and see if it then works.
    If that doesn't solve it then what has worked for some people is going into Settings > General > Date & Time and changing the date to a few months (or maybe a year or two) in the future and then re-trying

Maybe you are looking for