How to connect to the mysql database using applet from remote PC

Hii All..
I am also facing a problem.
My web server and mysql server are running on the same PC.
when i connect to the database from the same PC.
Its connection but when i am trying to connect to the database from the different PC its giving error and not finding the driver "com.mysql.jdbc.Driver" because this is there on the server PC and applet runs on the client side..
So to load the deriver on the client side so that it can run the applet to make the database connection on the remote PC.
Thanks
Uttam

You are missing the library on the client.
It must be moved to the client.
Just like any other library that an applet requires.
And that has nothing to do with JDBC.
There are certainly way(s) to do it. Perhaps a forum that addresses applets, web usage or guis would provide an answer.

Similar Messages

  • Can't Connect to the Mysql Database using J2SE jdk1.5

    Can anyone tell me why this error occurs ????????????????????
    Following are the codes ;
    package dbconnect2;
    import java.sql.*;
    public class dbconn2 {
    public static final String URL =
    "jdbc:mysql://localhost:3306/test";
    public static final String USERNAME = "test";
    public static final String PASSWORD = "password";
    * @param args the command line arguments
    public static void main(String[] args) throws Exception {
    // TODO code application logic here
    Connection connection = null;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(URL,
    USERNAME, PASSWORD);
    Statement stm = connection.createStatement();
    ResultSet rs = stm.executeQuery("select * from emp");
    while (rs.next())
    String strnaam = rs.getString("emp_name");
    System.out.println(strnaam);
    finally {
    if (connection != null)
    connection.close();
    ================================================================================
    This is the run time error ;
    init:
    deps-jar:
    compile:
    run:
    Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at dbconnect2.dbconn2.main(dbconn2.java:39)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    please help me to sort this out
    Thanks
    Sishani

    I've solved the DW problem by changing the site folders from
    'db' to 'wwwroot' e.g. 'C:\CFusionMX\db\' is now
    'C:\CFusionMX\wwwroot\
    However I'm now back to my original problem. I've lost my
    mqysql connection in CF Adminstrator. Before I made these changes I
    could connect to my mysql databases using the following settings:
    JDBC URL: jdbc:mysql://localhost:3306/test
    Driver Name: MySQL Connector J
    using the following Java path and file:
    C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar
    Now these settings give me the following error:
    "Connection verification failed for data source: javaserver
    []java.sql.SQLException: SQLException occurred in JDBCPool
    while attempting to connect, please check your username, password,
    URL, and other connectivity info.
    The root cause was that: java.sql.SQLException: SQLException
    occurred in JDBCPool while attempting to connect, please check your
    username, password, URL, and other connectivity info"
    Any suggestions on this would also be welcome.
    Thanks again to everyone for their help.
    Sincerely,
    Graham A. Kerby

  • [Forum FAQ] "Unable to connect to the server by using Windows PowerShell Remoting" error while installing RDS roles on Server 2012 R2

    When you try to install RDS role on server 2012 R2 using standard deployment, this issue may occur (Figure 1).
    “Unable to connect to the server by using Windows PowerShell remoting”.
    Figure 1: Unable to connect to the server by using Windows PowerShell remoting
    First of all, we need to verify the configurations as it suggested:
    1. The server must be available by using Windows PowerShell remotely.
    2. The server must be joined to a domain.
    3. The server must be running at least Windows Server 2012 R2.
    4. The currently logged on user must be a member of the local Administrators group on the server.
    5. Remote Desktop Services connections must be enabled by using Group Policy.
    In addition, we need to check if the “Windows Remote Management “service is running and related firewall exceptions have been created for WinRM listener.
    To enabling PowerShell remoting, we can run this PowerShell command as administrator (Figure 2).
    Enable-PSRemoting -Force
    Figure 2: Enable PowerShell Remoting
    However, if issue persists, we need to check whether it has enough memory to work.
    By default, remote shell allots only 150 MB of memory. If we have IIS or SharePoint App pool, 150 MB of memory is not sufficient to perform the remoting task. Therefore, we need to increase
    the memory via the PowerShell command below:
    Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000
    Then, you need to restart the server and the issue should be resolved.
    You can get more information regarding Remote Troubleshooting by below link:
    about_Remote_Troubleshooting
    If you need further assistance, welcome to post your questions in the
    RDS forum.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    i found another possible reason, this solution worked for me:
    http://oyvindnilsen.com/solution-for-powershell-remoting-error-it-cannot-determine-the-content-type-of-the-http-response-from-the-destination-computer/
    I tried to set up powershell remoting on a server and kept getting this error:
    Enter-PSSession : Connecting to remote server failed with the following error message : The WinRM client cann
    ot process the request. It cannot determine the content type of the HTTP response from the destination comput
    er. The content type is absent or invalid. For more information, see the about_Remote_Troubleshooting Help to
    pic.
    After a bit of troubleshooting I discovered that the problem was that the authentication packets was to big (over 16k), this will cause WinRM to reject the request. The reason for authentication packets getting too big can be because the user is member of very
    many security groups or in my case because of the SidHistory attribute.
    The solution was to increase the MaxFieldLength and MaxRequestBytes keys in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters
    If the keys does not exists you can create them, be sure to use the DWORD type.
    I sat MaxFieldLength to DEC value 40000 and MaxRequestBytes to DEC value 32768 and rebooted the server. Problem solved.

  • Connecting to a Mysql database using CF Administrator and DW

    I can't create a mysql datasource in CF Administrator.
    If I use the following datasource settings in CF
    Administrator:
    JDBC URL: jdbc:mysql://localhost:3306/test
    Drive Class: MySQL Connector J
    AND (note the emphasis) I set my local and remote folders in
    my DW site local folder, remote folder and testing server folders
    all to C:\CFusionMX\db\, I can connect to my mysql database in CF
    Administrator.
    However, with these DW site folder settings, DW doesn't
    recognize any databases (Access or Mysql) at all.
    When I change my DW site folder settings to 'wwwroot'
    (e.g.local folder C:\CFusionMX\db\' is changed to
    'C:\CFusionMX\wwwroot') DW now lists all my CF Administrator
    databases.
    The problem is CF Administrator can't connect to my Mysql
    data sources. It gives me the error:
    "Connection verification failed for data source: javaserver
    []java.sql.SQLException: SQLException occurred in JDBCPool
    while attempting to connect, please check your username, password,
    URL, and other connectivity info.
    The root cause was that: java.sql.SQLException: SQLException
    occurred in JDBCPool while attempting to connect, please check your
    username, password, URL, and other connectivity info"
    I've tried changing the 3306 port to 8500, but this doesn't
    help.
    My java path and connector file is:
    C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar,
    Is this a ID/password problem? I've tried both 'root' and
    leaving the ID field in the CF Administrator add data source block,
    both to no avail. I don't have a password set in Mysql for 'root'
    either.
    Any help would be gratefully appreciated. I've been working
    on this for weeks and keep running into one problem after another.
    Thanks a million in advance.
    Sincerely,
    Graham A. Kerby

    1) ensure mysql server is running
    2) there are numerous tutorials for mysql installation out
    there
    3) there are good free mysql admin tools out there
    4) use both the above to verify your mysql installation is
    correct
    5) please tell me you do have your zonealarm DISABLED
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Connecting to a Mysql database using a ColdFusion server

    can't create a mysql datasource in CF Administrator.
    If I use the following datasource settings in CF
    Administrator:
    JDBC URL: jdbc:mysql://localhost:3306/test
    Drive Class: MySQL Connector J
    AND (note the emphasis) I set my local and remote folders in
    my DW site local folder, remote folder and testing server folders
    all to C:\CFusionMX\db\, I can connect to my mysql database in CF
    Administrator.
    However, with these DW site folder settings, DW doesn't
    recognize any databases (Access or Mysql) at all.
    When I change my DW site folder settings to 'wwwroot'
    (e.g.local folder C:\CFusionMX\db\' is changed to
    'C:\CFusionMX\wwwroot') DW now lists all my CF Administrator
    databases.
    The problem is CF Administrator can't connect to my Mysql
    data sources. It gives me the error:
    "Connection verification failed for data source: javaserver
    []java.sql.SQLException: SQLException occurred in JDBCPool
    while attempting to connect, please check your username, password,
    URL, and other connectivity info.
    The root cause was that: java.sql.SQLException: SQLException
    occurred in JDBCPool while attempting to connect, please check your
    username, password, URL, and other connectivity info"
    I've tried changing the 3306 port to 8500, but this doesn't
    help.
    My java path and connector file is:
    C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar,
    Is this a ID/password problem? I've tried both 'root' and
    leaving the ID field in the CF Administrator add data source block,
    both to no avail. I don't have a password set in Mysql for 'root'
    either.
    Any help would be gratefully appreciated. I've been working
    on this for weeks and keep running into one problem after another.
    Thanks a million in advance.
    Sincerely,
    Graham A. Kerby

    If it were me I would use the MySQL JDBC driver and not ODBC. Then DSN versus not-DSN wouldn't be an issue.

  • How to connect to a MySQL database in another server

    Dear friends,
    I am using Oracle SQL Developer 1.5.3 and I need to connect to a MySQL database located in another server.
    I am trying to create a new connection, informing connection name, username and password. Supposing that "Hostname" is the IP server address, I click on "Choose database", but I always receive the following error message: "Status : Failure - Cannot connect to MySQL server".
    Please tell me what I should do to solve this situation. Thanks in advance.
    Best regards,
    Franklin

    You need to configure your mysql database to accept connection from your PC for the user you used.
    For example,
    GRANT ALL ON *.* TO 'someuser'@'somehost';
    FLUSH PRIVILEGES;

  • How to insert data into mysql database using GUI?

    HI there,
    I have created a GUI application using Netbeans 6.7.1 in which there are three jtextfields. Now from those text fields i have to insert data in the mysql database. I have already connected to mysql using drivers and URL which is used to connect to DB. So what code should i write in the source of these text fields. Please help me and give the code to it.
    I actually don't know what code to be written in the source of a text field.
    Thank You.

    Yo buddy i didn't mean that. I wanted to say that if you see my project then it will be easy for you to help me. okay have a look at this code and tell me i have just created my gui
    This is Main.java -->
    package bookdatabase2;
    import java.sql.*;
    import java.awt.*;
    import javax.swing.*;
    * @author Mohd Azeem
    public class Main {
    * @param args the command line arguments
    public static void main(String[] args)throws Exception {
    // TODO code application logic here
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","");
    //PreparedStatement state=con.prepareStatement("select * from titles");
    //ResultSet result=state.executeQuery();
    //while(result.next()){
    // System.out.println(result.getString(1)+" "+result.getString(2)+" "+result.getString(3)+" "+result.getString(4));
    This the gui i have created
    BookDatabase.java -->
    package my.bookdatabase;
    import java.sql.*;
    import javax.swing.*;
    public class BookDatabase extends javax.swing.JFrame {
    public BookDatabase()throws Exception {
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","");
    initComponents(); }
    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                           
    // TODO add your handling code here:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
    public static void main(String args[])throws Exception {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    try{
    new BookDatabase().setVisible(true);}
    catch(Exception e){}
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    // End of variables declaration
    Now tell me what to do?
    i have only created the gui but unable to run it
    when i click on run only main.java is being executed
    but bookdatabase.java is not getting executed?
    what should i do please help?

  • How to Connect Microsoft SQL 2000 database using JDBC

    Hi all..
    I want to connect Microsoft SQL 2000 database using JDBC. I want from initial steps also. (about JDBC driver & its installation)
    Thankz

    Just checkout the SQL Server JDBC Driver Documentation at the manfacturer's site: http://msdn2.microsoft.com/en-us/data/aa937724.aspx

  • How to connect servlet to mysql database

    Hi all,
    I am new to mysql. After many difficulty I have created a database with table in MySql. Now I want to connct it to a servlet. How do I do it?
    Can anyone tell me the steps, including the step to create MySql datasource
    thanks

    thanks for the reply. I know the basics of jdbc and can connect with sqlserver. Bt how to connect with Mysql? I mean what do I provide in dsn unless I create a MySql datasource. I cant find any tutorial which teaches how to create MySql datasource. Can you give me any link???
    thanks

  • How to connect Oracle 7.x database using weblogic 11g

    Hi,
    For one of my requirement, I need to connect to a Oracle 7.x database using weblogic 11g Application server.
    Any idea?

    Tried as per the suggestion from the link :
    http://jvzoggel.wordpress.com/2011/07/26/weblogic-ojdbc-driver/
    It worked.

  • How to connect JSP with MySql Database?

    HI All...
    I want to know or How to connect Mysql with JSP or JSF any other software is available? please help me.....

    I want to know or How to connect Mysql
    with JSP or JSF any other software isavailable?
    please help me.....First you need to find 25 m of a CatV cable and...The DB files need to be located on the ninth device of a SCSI Daisy Chain with the total SCSI cable length being over 150 m (and the devices (and cables) need to be mix of Differential and Non-Differential).
    Edit: And forget the terminator, who needs it?

  • How to store files in mysql database using JSP?

    I'm developing an online recruitment system using JSP in server side. For the users who registers in it, I want them to upload their cv's from the web site so that I can store it in the database..I'm using mysql as the db..
    Can I know how to do it.?..or else is there any better way of doing that?
    Need a quick reply..Tx

    The best way to put data in a database in a JSP is to not do it. Instead, use a Servlet that calls a DataAccessObject. The DAO puts the data in the DB and the servlet gives the data to the DAO. The JSP does nothing but display results.
    Take a google for JSP MVC and DAO. BalusC has a great example of DAO and a JSP that uses one on his blog.

  • Accesing the mysql database using jsp

    hi. I'm trbing to access the mysal data base using the following jsp code. but it gives me the exception: Exception is: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    please help.
    <%@ page language="java" import="java.sql.*" %>
    <%
         String JDBC_DRIVER = ("com.mysql.jdbc.Driver");
         String DATABASE_URI = ("jdbc:mysql://localhost/MCQTest?user=root&password=vishanka" );
         Connection con=null;
         ResultSet rst=null;
         Statement stmt=null;
         int noOfQuestions = 30;
         String [] question = new String [noOfQuestions];
         try
              Class.forName(JDBC_DRIVER).newInstance();
              con=DriverManager.getConnection(DATABASE_URI);
              stmt=con.createStatement();
              rst = stmt.executeQuery("select question from question");
              while(rst.next())
                   for(int i = 1; i<=noOfQuestions; i++)
                        question[i-1] = rst.getString(i);
                        out.print(question[i-1]);
              rst.close();
              stmt.close();
              con.close();
         catch(Exception ex)
              {out.println("Exception is: " + ex.toString());ex.printStackTrace();}
    %>
    <html>
    <head><title>StudentRegistration Front</title></head>
    <jsp:useBean id="user" class="beans.User" scope="session" />
    <body>
    <font color="blue">
    <h2 align="center">
    <p>Welcome <jsp:getProperty name="user" property="name" />:
    </h2>
    </font>
    <form action="marking.jsp" method="post">
    <h4 align="center">
    <input type="submit" value="submit">
    </h4>
    </form>
    </font>
    </body>
    </html>

    sorry guys. the code is given below clearly.
    <%@ page language="java" import="java.sql.*" %>
    <%
         String JDBC_DRIVER = ("com.mysql.jdbc.Driver");
         String DATABASE_URI = ("jdbc:mysql://localhost/MCQTest?user=root&password=vishanka" );
         Connection con=null;
         ResultSet rst=null;
         Statement stmt=null;
         int noOfQuestions = 30;
         String [] question = new String [noOfQuestions];
         try
              Class.forName(JDBC_DRIVER).newInstance();
              con=DriverManager.getConnection(DATABASE_URI);
              stmt=con.createStatement();
              rst = stmt.executeQuery("select question from question");
              while(rst.next())
                   for(int i = 1; i<=noOfQuestions; i++)
                        question[i-1] = rst.getString(i);
                        out.print(question[i-1]);
              rst.close();
              stmt.close();
              con.close();
         catch(Exception ex)
              {out.println("Exception is: " + ex.toString());ex.printStackTrace();}
    %>
    <html>
    <head><title>StudentRegistration Front</title></head>
    <jsp:useBean id="user" class="beans.User" scope="session" />
    <body>
      <font color="blue">
      <h2 align="center">
        <p>Welcome <jsp:getProperty name="user" property="name" />:
      </h2>
      </font>
      <form action="marking.jsp" method="post">
         <h4 align="center">
             <input type="submit" value="submit">
        </h4>
      </form>
      </font>
    </body>
    </html>

  • How to connect to HR sample database using ODBC?

    This is for Oracle Express running on Ubuntu 8.10.
    The SQLConnect ODBC call requires datasourcename/dsn, userid and password as parameters.
    What are these for the HR sample database?

    Many thanks.
    I have only just downloaded Oracle Express and have never used Oracle before, so I do not understand the meaning of service name.
    The userid and password for HR are both hr, which just leaves the dsn.

  • Getting error while trying to connect to the oracle database using SQL Deve

    Hi everybody,
    I installed sql developer and want to make a new connection, but it shows:Status: Failure- Test failed:IO Error:The Network Adapter could not establish the connection.
    Please anybody help me. Appreciate you, in help.
    Thank You,

    This is usually a problem with either your connection definition, or the basic network setup.
    Try following the trouble shooting steps here

Maybe you are looking for

  • How to install Oracle VM Server 2.2.0 as 32-bit mode on a 64-bit machine.

    Gurus, If I am not wrong, the Oracle VM Server 2.2.0 installer for 32-bit and 64-bit are the same file. I have AMD 64 bit machine, when I install Oracle VM Server 2.2.0, it installs as 64-bit. However due to requirement, I want to install Oracle VM S

  • Is there a way to have the same information appear twice on a form?

    I have a form set up for campers to register for a week of camp The first page is general information the 2nd page will be a Health record. When I print it off 1 page goes to the registration table and 1 page to the Nurse. I need the campers name and

  • Logic will not open with out external soundcard after Mavericks upgrade

    Hi Recently upgraded my Mac to Mavericks and my Logic 9.1.8 (32 Bit) worked fine. I have a Digidesign 002 rack which I was using as an external soundcard. These all worked fine until I updated my Digi drivers. Now Logic will not open unless the Digi

  • Codec could not be opened error in red

    Out of the blue, suddenly the screen went completely green during playback but an error message said codec could not be opened. The error message had a red background. Have audio but no picture. It just stays green. At first i was thinking perhaps it

  • I want to learn

    what books do I need to buy  in understanding photoshop and illustrator Im an old school illustrator form the 1970s-80s and this is all new to me but i love it can you masters help thanks.old school master. ps. we did not have this back in the day.