JDBC and MySQL connectivity problem

The code i hav attached generates Connectivity exception.. the prob is with the part in bold.. can anyone help
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class testconn {
  public static void main(String args[]) {
    Connection con = null;
            String serverName = "localhost:8080";
        String mydatabase = "imagedb";
        String url = "jdbc:mysql://" + serverName +  "/" + mydatabase; // a JDBC url
        String username = "am";
        String password = "ta";
    try {
      Class.forName("com.mysql.jdbc.Driver");
     con= DriverManager.getConnection(url, username, password);
      if(!con.isClosed())
        System.out.println("Successfully connected to " +
          "MySQL server using TCP/IP...");
    } catch(Exception e) {
      System.err.println("Exception: " + e);
    } finally {
      try {
        if(con != null)
          con.close();
      } catch(SQLException e) {}
}

I had such issue too, and I fixed it by adding in the environment variables the CLASSPATH entry that pointed to all the directories containing the .jar needed for the applications.
for example I used jodbc folder to connect mysql database (I installed last version and I got same issue than yours and it seems to be a 'connector' issue, exactly the same issue than yours) I got something like
CLASSPATH=my root dir/the java dir/the lib dir/jodbc;my root dir/the java dir/other important libs containing .jar files;
This is what I got for the issue, still working around (at the level of mysql all is ok, ...)
Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Hurukan>java ConnectJODBC brol
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at ConnectJODBC.main(ConnectJODBC.java:108)
[exception] -- la valeur de 'con' est nulle (DriverManager � retourn� une valeur
nulle)
C:\Documents and Settings\Hurukan>set
APPDATA=C:\Documents and Settings\Hurukan\Application Data
CLASSPATH=c:\Program Files\Java\jdk1.5.0_06\lib;c:\Program Files\Java\jdk1.5.0_06\dev;\c:\Program Files\Java\jdk1.5.0_06\lib\jodbc;
Here is the code that generated this exception
String dburl="jdbc:mysql://127.0.0.1/nosdisques"; // should be next passed by command line
String password="**scrambled**";
String username="**scrambled**";
Connection con=null;
Statement stmt=null;
ResultSet res=null;
String requete="";
String strToWrite="";
// Connexion � la base de donn�e
// Won't work with mysql 5.0.18, mysql connector 3.51.12 is installed [???]
// Previous tests with 5.0.18 were running good, that has started with the last os restoration (and the connector was different of course...)
// tried to retreive older version of the mysql connector
try
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=DriverManager.getConnection(dburl,username,password);
System.out.println("Nous sommes connect\u201as \u2026 la base " + con.getCatalog());
catch(SQLException sqlex)
System.out.println("[sqlexception]\n");
System.exit(3);
catch(Exception ex)
ex.printStackTrace();
if(con == null)
System.out.println("[exception] -- la valeur de 'con' est nulle (DriverManager \u2026 retourn\u201a une valeur nulle)\n");
System.exit(4);
System.out.println("Impossible to join database, access denied\n");
System.out.println("Verify settings (mysqld or firewall)\n"); System.exit(2);
Maybe the drivers used (last one: connector/j 3.1.12). The .jar file is in the %classpath% directory c:\Program Files\Java\jdk1.5.0_06\lib.
Can't really understand why this code won't run anymore, ...
I took a look on the other computer where the same code is running ok.
These are the differences:
mysql server is 5.0.18 on the other computer the version is 3.23.41
mysql connector is 3.51.12 on the other computer the version is 3.0.10
access rights are the same because the database is the dumped one from 3.23.41 to 5.0.18, and I'm quite good with the dbms management (I'm IT developper in fact, trying to take over java technology ;) )
in this case this is not a sql error but java error.
the jar file is set to the %classpath% folder on both computers
I copied the jar from the other computer, removing the new .jar file and... it failed, exactly the same issue
Still working around, ...
Dimitri

Similar Messages

  • PHP and MySQL Connection problem

    I am trying to make a PHP MySQL on a remote server connection in Dreamwesaver CS3.
    When I enter the information (host, user, password, etc.) and hit TEST, I get the following error message.
    "Access Denied. The file may not exist, or there could be a permission problem. Make sure you have proper authorization on the server and the server is properly configured."
    I know the user, password, etc. work, as I can access the MySQL database with other software.
    I checked with my host and they say there are no permission problems on their end.
    I have checked the settings on the Test Server page in Site Setup and everything looks correct and works there.
    I have not seen this particular problem described in other forum postings (although there are a LOT of postings on this topic!).
    Any help would be appreciated.

    I thought my testing server was the remote server and is always on as far as I know. I don't know how to turn it on or off.
    Is there some other testing server that I should be aware of?
    Frank
    Date: Wed, 3 Jun 2009 15:43:02 -0600
    From: [email protected]
    To: [email protected]
    Subject: PHP and MySQL Connection problem
    I know you are using remote, but is your testing server on? if not turn that on and see if that does it. it just happened to me working on remote server and could not get mysql conn to work, until I turn on my testing (developer server), then I was able to connect to mysql and the tables that I created in phpmyadmin remotly was downloaded.
    >

  • JDBC/MYSQL Connection problems

    I'm new to using JDBC so I'm not sure if I'm simply doing something wrong in my code or if I've installed something incorrectly. I've got the JDBC connector/J installed properly as far as I can tell. At least when I run my code I'm not getting an error about the driver not being found. The problem I'm running into is that even though I've double and triple checked the authentication info I keep getting the following error:
    Exception in thread "main" java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user: '[email protected]' (Using password: YES)"
    The actual connection commands I'm using are as follows:
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/Test", "testusr", "testpwd");
    I've checked and rechecked the spelling of my mySQL user & password and as far as I can tell, they work just fine so I can't figure out why I would be getting this error. Any suggestions on things I can try or does anyone see any obvious errors in what I'm doing?

    The failure is caused not by the JDBC driver but by how the MySQL was configured
    when it was installed. By default, MySQL is configured to allow connections that
    are created only from within the localhost.
    The line
    DriverManager.getConnection("jdbc:mysql://localhost:3306/Test?user=testusr& password=testpwd") translates to "create a connection to MySQL running at 'localhost' and use the
    'testusr@<hostname.domain>' as user name and 'testpwd' as the password".
    If you can see, the <hostname.domain> is replaced with "other value" aside from
    the "localhost" which you expect, hence connection is denied.
    The '<hostname.domain>' is replaced with the value of either your IP address or
    hostname. Therefore, any connections created from outside the host where your
    server is running will be denied. Now, making the 'host' value set from
    'localhost' to '%' would tell MySQL that you are allowing connections created from
    outside the MySQL host to connect to the server.
    Another way to go around this is problem is to modify your
    "\Windows\system32\drivers\etc\hosts" OR "/etc/hosts" file and give
    your loopback address (127.0.0.1) another alias (aside from localhost), e.g.:
    127.0.0.1    localhost    <hostnameY.domain>
    192.168.1.1  <hostnameX.domain>  <hostnameY.domain>where you replace <hostnameY.domain> with the name/alias of your computer in
    the network. The domain is optional and depends upon the domain name that
    your network is using.

  • MySQL Connectivity problem

    Hi all,
    I am new to JSP. I am using Eclipse 3.2. with all lpugins. The following code throws an error. Pleas help me.
    <html><body>
    <%@ page import="java.sql.*, java.lang.ClassNotFoundException"%>
    <%
         String connectionURL = "jdbc:mysql://localhost:3306/online_hotel_booking";
         String userName = "root";
         String password = "root";
         // Load the driver class and establish a connection
         try {
              Class.forName("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection(connectionURL,userName,password);
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("select * from hotel_details");
              while (rs.next()) {
                   out.println(rs.getString(1));
                   out.println(rs.getDate(2));
              /* closing the connection */
              rs.close();
              stmt.close();
              con.close();
         catch (Exception e) {
              out.println("Exception!"+e);
    %>
    </body></html>It throws ClassNot FoundException: com.mysql.jdbc.Driver
    Thanks in advance

    JDBC questions should be posted in the JDBC forum: http://forum.java.sun.com/forum.jspa?forumID=48
    If you take the time to look the active topic listing of the JDBC forum, you'll see that you're not the only one who encountered the problem. Yesterday I answered similar topic on this issue.

  • JSP Mysql Connection Problem

    Hi Friend,
    I am facing some problem in connecting mysql with jsp .
    When I try and connect to mysql with the following connection string
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/testdhiraj?user=root&password=dh");
    Statement statement     = con.createStatement();
    I get an error :
    java.sql.SQLException: Communication link failure: Bad handshake
    I don't know what is wrong,
    as I had tested mysql using telnet and it connects and executes sql nicely.
    Waiting for ur reply,
    Dhiraj Agrawal
    mail to : [email protected]

    Hi,
    You need to make sure that , you have given correct database name, user id and password in the connection url. and also check the jdbc driver is loaded properly. If your mysql is running in the standard port, you need not give the port as 3306.
    Here is the example :
    import java.sql.*;
         Notice, do not import org.gjt.mm.mysql.*
    or you will have problems!
    public class XampleClass
    public static void main(String[] Args)
    try {      
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    catch (Exception e) {
    System.err.println("exception while loading
    driver.");
    e.printStackTrace();
    try {
    Connection C = DriverManager.getConnection(
    "jdbc:mysql://localhost/test?user=myuser&password=mypwddb");
    // Do something with the Connection
    catch (SQLException e) {
    System.out.println("Exception: " + e);
    This is the format for conenction url :
    jdbc:mysql://[hostname][:port]/dbname[?param1=value1][&param2=value2]...
    Hope this helps you.
    Thanks,
    Senthil_Slash

  • Few question about Java and MySQL connection

    Hi!
    I have some problems with creating connection between Java and MySQL.
    I followed the restrictions in mysql-connector-java.jar' readme, I set the CLASSPATH :
    CLASSPATH=.;D:/mysql/mysql-connector-java.jar;
    I copied this jar file to the right place (descripted above), and I used the right steps to load it:
    Class.forName('com.mysql.jdbc.Driver"); and it throws a ClassNotFoundException
    Why? All the paths are correct, everything is on the right place.... I dont know why.
    When I installed the JBuilder8, and copied the jar file to JBuilder8/jdk4/jre/lib/ext it worked without any CLASSPATH in enviromental variables.
    If I want to run my program on machines where are not JBuilder, what should I do?
    Please help, if you can.
    Thanks,
    henpanta

    Yeah. So if I compiled my program with JBuilder to an .exe file, I cant run it on other machines, if the jar file isnt in the same place?
    If I tried your advice, java -classpath mymainclass I got the next message:
    main class not found. Believe me, its there. :(

  • JDBC or account connectivity problem?

    Dears
    I'm new with JDBC and i have a small issue while connecting.
    I use JDBC Connector with MySql5.1 on my mac
    Basically i have installed the server and by default the account with username "root" and empty password is there.
    I have created a database "Test", when i try to access it with the username "Root" and password "" it works fine, the problem comes when i try to access with another username e password
    Via MySql Administrator i have created a new account, when i try to access the "Test" database with the new user and password (in exactly the same way as with the 'root' user, only with ofcourse the new username and password) it gives me an access Exception "Access denied for user 'newUsername' on database "Test".
    I annot understand why, i mean the username and password have access to the whole server not only to one specific database, so it should be ok to access this "Test" database with a new username and pass.
    Any advice?

    I doubt this has anything to do with JDBC. At least excluding that you do have the user/password correct in the java code.
    You probably need to provide roles or permissions specific to the database in relation to the user.

  • Weblogic8.1 and mysql connection failure, please help

    Pardon me for repeating this topic. I have spent 2 days on this but still ended
    up with failure.
    The similar configuration works very well under wls7.0.
    It should not be a problem of jdbc driver or its classpath setting, since the
    system console say "successful..."
    But when I try to access jsp and servlets, it always throws execeptions. All projects
    run successfully under wls7.0 don't work.
    Please give me some advice, thanks in advance.
    The following is my connection pool setting found in config.xml:
    <JDBCConnectionPool DriverName="com.mysql.jdbc.Driver"
    Name="MySQLConnectionPool" Password="{3DES}aMsyd4ZSbSg="
    Properties="user=root" Targets="cgServer" URL="jdbc:mysql://localhost/userdb"/>
    <JDBCTxDataSource EnableTwoPhaseCommit="true"
    JNDIName="MySQLDataSource" Name="MySQLDataSource"
    PoolName="MySQLConnectionPool" Targets="cgServer"/>
    The screen shot of the exceptions is as below:
    <2003-8-21 ÏÂÎç17ʱ14·Ö08Ãë EST> <Notice> <WebLogicServer> <BEA-000355> <Thread
    "ListenThread.Default" listening on port 7001, ip address *.*>
    java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:476)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:181)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:223)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:217)
    at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenera
    tor.java:71)
    at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFac
    tory.java:331)
    at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.
    java:167)
    at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
    y.java:66)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:431)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    <2003-8-21 ÏÂÎç17ʱ14·Ö42Ãë EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id
    =2960804,name=forum,context-path=/forum)] Root cause of ServletException.
    java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:
    MySQLConnectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
    connectionPoolID=MySQLConnectionPool, dataSourceName=MySQLDataSource}.
    Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
    at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.ja
    va:141)
    at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
    y.java:73)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:431)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:395)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:448)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:431)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >

    1. This assumes that you have downloaded the mysql database and configured it and started
    it by running mysqld. In my case, I installed it in d:/mysql.
    2. It also assumes that you have configured a user on the database.
    I configured a user "test" with password "test" on the database "mysql" on "localhost" using
    mysql --user=root mysql
    grant all privileges on *.* to test@localhost identified by 'test' with grant option;
    3. It assumes that you have downloaded the Connector/J zip file and pulled out the jar file.
    In my case, I renamed it and copied it to d:/mysql/lib/jdbc.jar.
    4. It is absolutely necessary that you put the jar file in your server classpath. It won't
    work without doing that. Then I booted the server.
    5. I used the WLS 8.1 console to configure the connection pool and associated data source.
    In my case, they look like the following:
    <JDBCConnectionPool DriverName="org.gjt.mm.mysql.Driver"
    Name="mysql" Password="test"
    Properties="user=test"
    Targets="myserver"
    TestTableName="SQL SELECT 1"
    URL="jdbc:mysql://localhost:3306/mysql"/>
    <JDBCTxDataSource
    JNDIName="myDataSource"
    Name="myDataSource"
    PoolName="mysql"
    Targets="myserver"/>
    Note that the console uses the old class name for the driver. There is a new class name but
    the old name still exists and we figured it would cover folks using the old and new classes.
    6. I'll attach a client program that looks up the datasource associated with the connection pool,
    gets a connection, and does some stuff with the connection.
    The user/password combination must have security priviledges in WLS to reserve a connection
    on the pool.
    The code for this program is taken almost entirely from the WLS JDBC documentation.
    This is all pretty standard stuff.
    "Roland" <[email protected]> wrote in message news:[email protected]...
    >
    Pardon me for repeating this topic. I have spent 2 days on this but still ended
    up with failure.
    The similar configuration works very well under wls7.0.
    It should not be a problem of jdbc driver or its classpath setting, since the
    system console say "successful..."
    But when I try to access jsp and servlets, it always throws execeptions. All projects
    run successfully under wls7.0 don't work.
    Please give me some advice, thanks in advance.
    The following is my connection pool setting found in config.xml:
    <JDBCConnectionPool DriverName="com.mysql.jdbc.Driver"
    Name="MySQLConnectionPool" Password="{3DES}aMsyd4ZSbSg="
    Properties="user=root" Targets="cgServer" URL="jdbc:mysql://localhost/userdb"/>
    <JDBCTxDataSource EnableTwoPhaseCommit="true"
    JNDIName="MySQLDataSource" Name="MySQLDataSource"
    PoolName="MySQLConnectionPool" Targets="cgServer"/>
    The screen shot of the exceptions is as below:
    <2003-8-21 ÏÂÎç17ʱ14·Ö08Ãë EST> <Notice> <WebLogicServer> <BEA-000355> <Thread
    "ListenThread.Default" listening on port 7001, ip address *.*>
    java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:476)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:181)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:223)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:217)
    at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenera
    tor.java:71)
    at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFac
    tory.java:331)
    at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.
    java:167)
    at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
    y.java:66)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:431)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    <2003-8-21 ÏÂÎç17ʱ14·Ö42Ãë EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id
    =2960804,name=forum,context-path=/forum)] Root cause of ServletException.
    java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:
    MySQLConnectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
    connectionPoolID=MySQLConnectionPool, dataSourceName=MySQLDataSource}.
    Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
    at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.ja
    va:141)
    at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
    y.java:73)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:431)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:395)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:448)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:431)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >[mysql.java]

  • PleaseHelp on jsp and Mysql connectivity and a lot of exception errors

    Hi,
    I am Trying to connect a JSP page with Mysql database. I am having a lot of probelms. After having a lot of problems in connecting the JSp with Mysql. Intilally it was giving me the exception error that " NO appropriate driver was found. After modifying the URl it was fine. Now It is giving the Following errors.
    servlet.ServletException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream ** BEGIN NESTED EXCEPTION ** java.io.IOException MESSAGE: Unexpected end of input stream
    In a window before loading the Explorer page it is giving the following error that The port 8081 is already in use and i should expand to other ports. Noraml JSP Files which used to work before are also not working .
    Internal Tomcat JWSDP is alos not working. If i try to start the server it says that port 8081 is already in USe . A java.net.connection exception is also occuring. The normal JSP files are also not working. What is Happening. I am also giving the code i have writted. PLease tellme why so many exception errors are occuring.
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8081/mis_project", "root", " ");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("Select study_semester FROM Semester");
    while(rs.next()) {
    %>
    <option value="<%= rs.getString("Study_Semester") %>">
    </option>
    <% }
    if(rs!=null) rs.close();
    if(stmt!=null) stmt.close();
    if(con!=null) con.close();
    I am trying to connect to Mysql and automatocally populate a field in a Form in later JSp pages i intend to record the data entered in these fields into other tables.

    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/myDB?user=username&password=mypass");
    Statement stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
    String cat = "";
              try{
              cat = request.getParameter("category");
              }catch(NullPointerException npe){}
              ResultSet rs = stmt.executeQuery("SELECT id,fullname FROM users WHERE category LIKE '%motor%' AND subcategory like '%"+cat+"%'");
         %>
    This piece gets a category parameter from a form post and uses it to search for a specific category in a database table. I think maybe u need to download JConnector from mysql site and unzip it to the classes folder of your WEB-INF in Tomcat server...... i hope this helps a bit

  • MySQL connectivity Problem URGENT plz

    Hi
    plz can any one help me... its urgent
    i need java to connect to MySQL database.with mm.mysql.Driver
    the following sample code is just copied from the site and made changes in hostname, dbname and username.
    classpath has been given correctly for the mm.mysql.Driver package (mysql.jar).
    Thanx in advance....
    Result
    compilation --> success
    while executing i get the following Error.
    java.sql.SQLException: General Error: null
         at org.git.mm.mysql.connection.<init>(Connection.java)
         at org.git.mm.mysql.Driver.connect(Driver.java)
         at java.sql.DriverManager.getConnection(DriverManager.java: 515)
         at java.sql.DriverManager.getConnection(DriverManager.java: 197)
         at JDBCDemoCreate.getConnection(JDBCDemoCreate.java: 36)
         at JDBCDemoCreate.<init>(JDBCDemoCreate.java: 14)
    java.lang.NullPointerException
         at JDBCDemoCreate.<init>(JDBCDemoCreate.java: 17)
         at JDBCDemoCreate.main(JDBCDemoCreate.java: 47)
    Here is the code. can any one try this !
    // JDBCDemoCreate.java
    1.     import java.util.*;
    2.     import java.sql.*;
    3.
    4.     public class JDBCDemoCreate {
    5.
    6.     private static final String hostname = "hostname";
    7.     private static final String port = "3306";
    8.     private static final String database = "dbname";
    9.     private static final String username = "username";
    10.     private static final String password = "";
    11.
    12.     public JDBCDemoCreate() {
    13.
    14.          Connection c = getConnection();
    15.
    16.          try {
    17.               Statement s = (Statement)c.createStatement();
    18.               s.executeUpdate("CREATE TABLE rich ( id int primary key, name char(25) )");
    19.          } catch ( Exception e ) {
    20.               e.printStackTrace();
    21.          }
    22.
    23.     }
    24.
    25.     private Connection getConnection() {
    26          // Register the driver using Class.forName()
    27.          try {
    28.               Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    29.          } catch ( Exception e ) {
    30.               e.printStackTrace();
    31.          }
    32.
    33.          // ask the DriverManager for a connection to the database
    34.          Connection conn = null;
    35.          try {
    36.               conn = DriverManager.getConnection("jdbc:mysql://" + hostname +
    37.                                                                      ":"+ port +"/" + database +
    38.                                                                      "?user=" + username +
    39.                                                                      "&password=" + password );
    40.          } catch (Exception e) {
    41.               e.printStackTrace();
    42.          }
    43.          return conn;
    44.     }
    45.     
    46.     public static void main( String[] args ) {
    47.          new JDBCDemoCreate();
    48.     }
    49.}

    Hi!
    You can try with this code coz, i worked with this code only and then i can talk to the database.
    Connection con;
    Class.forName("org.gjt.mm.mysql.Driver";
    con = DriverManager.getConnection("jdbc:mysql:///db?user=root&password=");
    Try it out!
    Queries regarding this is welcome. Either in this forum itself or u can contact in the mail, the id is
    [email protected]
    Regards,
    dinesh

  • DW CS3 to MySql connection problem

    I have DW CS3 on Windows Vista. I have installed the Apache
    web server and MySql. I've associated the Apache server for testing
    and it works fine for page displays, so when I make a change to a
    page and hit F12 it is uploaded to the test environment and
    displayed in a browser.
    MySql is up and running, I can log onto it with the MySql
    admin client and see my database (just a testing one).
    When I try to test the sql connection I get the message "An
    unidentified error has occurred" and I don't have access to the
    data.
    When I try to test a PHP page it is treated as a file object
    and not processed, just loaded for editing.
    I don't know what I've set up wrong, any help
    appreciated.

    Was this issue resolved?
    I have the same problem now. DW was working fine the one day and the next when I started it it had this connection problem.
    I am testing on my local PC. My sites is at http://localhost/
    All my connection are working because if I go to http://localhost/index.php I can see my site and if I go to http://localhost/register.php I can even register a new user. It will include the new user details in the data base and everything is working fine. So there is nothing wrong with the connection.
    In DW I do have http://localhost/ on the Local Info screen. As I said, all was working fine on the current setup the one day and the next day it did not want to work.
    Seems like a very common problem.
    I want to buy CS4 and surely hope that the problem has been fixed by now.

  • DW CS4 MySQL Connection Problem

    I know this one has been covered before but i've been trawling through posts for the past 2 days and still haven't solved my problem.
    I remember from using MX Studio and Ultradev that setting up a connection could prove challenging. It seems that CS4 is just as user-unfriendly in this regard. I know that the settings i'm using for the connection must be correct as i'm using them to successfully connect to the database and display its records using a hand-coded page. I've tried disabling Kaspersky and Windows Firewall but to no avail. I noticed one difference between the php script that dw attempted to make and mine is that i'm using mysqli whereas the dw version just refers to mysql. When I click on the Select button to try and select the database i just get  "An unidentified error has occurred" - about as much use as a chocolate fireguard - well done to the dw development team for that pearl of wisdom. Is dw trying to find my databse somewhere where it's not located? I noticed that C:/InetPub and its subfolders are marked "read only" but when you uncheck this, it reverts to read only - i don't know if this may have something to do with my inability to set up a connection. I managed to manually set up MySQL, PHP and Apache without problems but this has got me beat. Is it bad design in dw or am i just stupid? Don't answer that! Any help would be greatly appreciated as i know there's a lot of good stuff in dw if i could only make a connection (and i'm on a 30 day trial with this) Why should something that looks so easy be so difficult! Thanks, Mark

    Hi PZ,
             You're correct! I just managed to get my connection to work. I looked in my php.ini file and it only had extension=php_mysqli.dll at the bottom of the page (the dll file to which this refers was in the ext folder). So, I just added extension=php_mysql.dll to the end of the php.ini file then downloaded the PHP 5.2.13 zip package from http://www.php.net/downloads.php and then copied the file php_mysql.dll into the ext folder. I got the clue about mysqli not being supported after i'd carried out a Site > Advanced > Remove Connection scripts - that at least gave me a message "Your PHP Server doesn't have the MySQL module loaded or you cant use the mysql(p) connect functions" - before i did this i just got a useless "An unidentified error has occurred" which left me no further forward. Thanks for your help!

  • CS6, FTP and MySQL Connection ERRORs

    Adobe CS6 Dreamweaver
    I have the latest + updates of CS6 for Mac OS X 10.7.4.latest
    I can FTP, but files are not readable after the upload, on any web hosting provider.
    I have to use a thrid party FTP application (CyberDuck or Trnsmit) to make this happen.
    NOT HAPPY about this £2500 CS6 Master Collection spend not working !!!!
    When I try to connect via MySQL I get this error and failed actions:
    https://dl.dropbox.com/u/5485939/adobe_CS6_dreamweaver_FTP_MySQL/Screen%20Shot%202012-07-1 3%20at%2011.11.57.png
    https://dl.dropbox.com/u/5485939/adobe_CS6_dreamweaver_FTP_MySQL/Screen%20Shot%202012-07-1 3%20at%2011.11.45.png
    https://dl.dropbox.com/u/5485939/adobe_CS6_dreamweaver_FTP_MySQL/Screen%20Shot%202012-07-1 3%20at%2011.11.19.png
    I have checked the folders & content for ...
    _mmServerScripts
    Connections
    are uploaded properly (having to use a third party FTP application, see above).
    I have the correct logins details for FTP and MySQL, as other MySQL Apps (Sequel Pro) have no problem connecting to any web hosting proivdier for MySQL using the exact same login details.
    This is the same on my iMac or my MacBook Pro.

    Hello David, I am having this issue getting errors while trying to get my SQL to connect with the server. I clicked on the link you provided and I get a "you do not have permission to view this" message. Can you please share what ever solution that adobe has with me too.
    I am really really irritated with this issue, as someone else stated this is really inconvenient when I want to get some work done. I am also upset that I bought this software, especially if I cant find a solution.

  • MacBook Pro and Airport connection problem

    My MacBook Pro has a volatile connection to my Airport Express base station.
    I have a 2-month old 15.4" MacBook Pro (Intel Core 2 Duo), all software updates are installed, etc. I connect to the internet through an Airport base station. For the past few days my MBP has had a dodgy connection, slowing down at seeming random and then occasionally disconnecting from the base station entirely, although the Airport icon on the MBP is always on. While downloading a file I noticed that the speed of the connection was incrementally slowing until it stopped, and it was only after a couple of retries and then connecting to the base station again (by finding it amongst the other networks on the pull-down menu that you get when you click on the Airport icon) that my connection resumed at its previous speed.
    My 12" PowerPC iBook connects to the internet over this Airport base station at full speed, no problems.
    I've tried resetting the PRAM on my MBP without change.
    One possibly noteworthy change is that this past week I updated my Parallels software to 3.0, which may have an effect based on some of the other threads I've read.
    What now?!

    After trying all of the above the suggestions, the problem returned as before. However, after digging some more I discovered that the issue appears to lie with the 10.4.10 version of the Mac OS; when I checked the software log under the system profiler I noticed that I had installed that update at about the time my Airport problems began. Apple then quietly released a v 1.1 combo update to 10.4.10 on July 2nd, which once installed appears to have resolved the problem. You can find the download at http://www.apple.com/support/downloads/macosx10410comboupdatev11intel.html
    What's curious is that originally Apple listed that the v 1.1 combo update resolved some issues with RAW image data, and some sound problems, which don't seem to have anything to do with Airport.

  • How to make JDBC and SAP connectivity with VC 6.0

    can anyone help me.....how to make JDBC system and SAP system visible in the System drop-down list in Data Task Panel of Visual Composer 6......i mean how to make connectivity with JDBC and SAP system......so that i can use any table in the back-end database as well as any BAPI in the R/3 system.........
    Thank you very much.....

    Hi Deep,
    There is a how-to posted on SDN regarding how to connect and configure the BI JDBC Connector.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    This document describes the jdbc driver to use etc.
    Hope this helps,
    Cheers,
    Scott

Maybe you are looking for

  • Skype Number - Recurring Charges

    Hello Skype Team, I have just bought my new Skype Number that I have to use for 2-3 months only. When I go to Manage Feature >> Settings, it says that my next payment shall be made in August, 2014 whereas I dont want the recurring payment to occur. P

  • Unable to change password in new email under same ID name

    I would like to change passward but now i have new email how i can do? and still would like to be same ID log in name

  • Can anyone get these to work??!!??!!  Airports don't work well together

    I have two airport expresses. I bought the second one to extend the range of my existing airport network. Both airports work fine when configured as a standalone main base station. But, when I set one up to be a remote/relay station, performance on b

  • Upgrade 10.3

    The new design is ugly. The new tiles, the backgrounds, the super sized button in most apps, it is ugly and not ergonomic. I would pay to get the previous version back, dismissing happily all new features. I would uninstall the amazon appstore, i do

  • Help running forms in 10g

    I have compiled all the forms fmb files and generated fmx respectively. Now, how do I run these forms. All the forms fmb and fmx files are residing on Application Server where the OC4J instance is also running. I want to run the forms 10g on the clie