Error connecting to MySQL database using JNDI

Hi,
I'm trying to do a simple connection to a MySQL database using the JNDI look-up
method.
Have tried this with the PointBase database that came with WebLogic and got it
to work successfully.
However got the attached error message when I tried it on MySQL database. I tried
this with both the WebLogic's driver for MySQL and also the one I downloaded from
MySQL (com.mysql.jdbc.Driver), and both failed with the same error message.
Offhand, it doesn't look like the connection pool is failing. Tested it with WebLogic's
"Test Pool" function and it was alright.
Also MySQL database is working properly. Test this by doing simple connection
and retrieval with simple JDBC connections and it works.
Any ideas what else I can check with regards to this problem?
Thanks!
[att1.html]

Hi Joe,
Attached is the config.xml for the domain that I'm working with. There are 3 connection
pools set-up.
The problematic Connection Pools are "MySQLCP" and "My JDBC Connection Pool"
Thanks for your help in this!
Joe Weinstein <[email protected]> wrote:
show us the pool definition, as it is in the config.xml file.
thanks
joe
Everbright wrote:
Hi,
I'm trying to do a simple connection to a MySQL database using theJNDI look-up
method.
Have tried this with the PointBase database that came with WebLogicand got it
to work successfully.
However got the attached error message when I tried it on MySQL database.I tried
this with both the WebLogic's driver for MySQL and also the one I downloadedfrom
MySQL (com.mysql.jdbc.Driver), and both failed with the same errormessage.
Offhand, it doesn't look like the connection pool is failing. Testedit with WebLogic's
"Test Pool" function and it was alright.
Also MySQL database is working properly. Test this by doing simpleconnection
and retrieval with simple JDBC connections and it works.
Any ideas what else I can check with regards to this problem?
Thanks!
Error 500--Internal Server Error
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:MyJDBCConnection Pool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
connectionPoolID=MyJDBC Connection Pool, dataSourceName=MyJDBC Data
Source}.
Nested Exception: java.lang.RuntimeException: Failed to Generate WrapperClass
     at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:141)
     at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.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(RmiDataSource.java:298)
     at jsp_servlet.__index._jspService(__index.java:142)
     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(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.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(RmiDataSource.java:298)
     at jsp_servlet.__index._jspService(__index.java:142)
     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(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[config.xml]

Similar Messages

  • Connecting to mysql database using DBLOGIN

    I am trying to connect to a mysql database through GG command interface and am unable to get the DBLOGIN to work correctly. Here is what I am getting:-
    mysql world -u root -p<password> (as user OS user mysql- works!)
    GGSCI (rac1) 5> DBLOGIN SOURCEDB world, USERID root, PASSWORD <password>
    2010-11-08 16:29:17 WARNING OGG-00769 MySQL Login failed: . SQL error (2002). Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
    ERROR: Failed to connect to MySQL database engine for HOST localhost, DATABASE world, USER root, PORT 0.
    I am not too familiar with mysql and will appreciate help and also pointer to documents that walk through setting up and testing Golden Gate with mysql.
    Thanks,
    Satish

    hi.
    i have same problem can't connect to mysql using dblogin on ggsci, please helpme
    this my.cnf configuration
    # Example MySQL config file for small systems.
    # This is for a system with little memory (<= 64M) where MySQL is only used
    # from time to time and it's important that the mysqld daemon
    # doesn't use much resources.
    # You can copy this file to
    # /etc/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options (in this
    # installation this directory is /var/lib/mysql) or
    # ~/.my.cnf to set user-specific options.
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.
    # The following options will be passed to all MySQL clients
    [client]
    #password     = your_password
    port          = 3306
    socket          = /tmp/mysql.sock
    #socket = /var/run/mysqld/mysqld.sock
    # Here follows entries for some specific programs
    # The MySQL server
    [mysqld]
    port          = 3306
    socket = /tmp/mysql.sock
    #socket          = /var/run/mysqld/mysqld.sock
    skip-locking
    key_buffer_size = 16K
    max_allowed_packet = 1M
    table_open_cache = 4
    sort_buffer_size = 64K
    read_buffer_size = 256K
    read_rnd_buffer_size = 256K
    net_buffer_length = 2K
    thread_stack = 128K
    # Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (using the "enable-named-pipe" option) will render mysqld useless!
    #skip-networking
    server-id     = 1
    # Uncomment the following if you want to log updates
    #log-bin=mysql-bin
    # binary logging format - mixed recommended
    #binlog_format=mixed
    # Uncomment the following if you are using InnoDB tables
    #innodb_data_home_dir = /var/lib/mysql/
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = /var/lib/mysql/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    #innodb_buffer_pool_size = 16M
    #innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    #innodb_log_file_size = 5M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50
    [mysqldump]
    quick
    max_allowed_packet = 16M
    [mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates
    [myisamchk]
    key_buffer_size = 8M
    sort_buffer_size = 8M
    [mysqlhotcopy]
    interactive-timeout

  • Error connecting to MySQL database

    Well I am a beginner trying to get the basics of JDBC. I am following a simple connection tutorial and I cannot even make this work. I receive an error when I run the program. It is a nested error that begins with "java.io.EOFException". I'm thinking it has something to do with the URL I am using to connect to the database. Any ideas?
    Here is the code I am using if that helps at all.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class jdbctry {
      public static void main(String args[]) {
        Connection con = null;
        try {
          Class.forName("com.mysql.jdbc.Driver").newInstance();
          con = DriverManager.getConnection("jdbc:mysql://url:port/database",
          if(!con.isClosed())
            System.out.println("Successfully connected to " +
              "MySQL server using TCP/IP...");
        } catch(Exception e) {
          System.err.println("Exception: " + e.getMessage());
        } finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
    } edit- I think the problem was I had a bad port number assigned to the URL. This time I got a "java.net.SocketException" error. It says my connection timed out.
    Message was edited by:
    lw22

    I'll assume that you've substituted appropriate values into that connection URL, right?
    It s
    // host = IP address or name of machine where MySQL is listening
    // port = 3306 (default)
    // database = instance you wish to connect to
    // username, password have to be GRANTed access rights.
    String url = "jdbc:mysql://host:port/database";Can you connect using the MySQL client and see the database you want in Java? If the client can't connect, neither can JDBC.
    %

  • Unable to connect to MySQL Database using MX

    I am unable to connect to MySQL database hosted on a remote
    server. I get the following error message:
    "HTTP Error Code 404 File Not Found. Here are some possible
    reason for the problem:
    1) There is no testing server running on the server machine.
    2) The testing server specified for this site does not map to
    the
    http://72.9.255.2/~keyitems/_mmServerScripts/MMHTTPDB.php
    URL. Verify that the URL Prefix maps to the root of the site."
    I have specified a testing server. My url is "
    http://72.9.255.2/~keyitems/........."
    For the URL prefix to the site's root folder, I listed the
    following:
    1.
    http://72.9.255.2/~keyitems/
    this did not work. I got the above error message.
    2.
    http://72.9.255.2/ this did not work
    also. I got the above error message.
    Any input would be great as I do not know where to start !!!
    Thank you

    Hi Ravi
    Glad to hear you solved this. It is very gratifying when one solves it alone, don't you think?
    Best wishes
    Michael

  • Error in connecting to mysql database using jsp

    Hi
    I've encountered this error:
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    while trying to connect to MySQL db.
    I've downloaded the driver from www.mysql.com, and set the classpath as: "C:\mm.mysql.jdbc-1.2b;%CLASSPATH%;"
    But it juz doesn't seem to work...
    Can someone pls help me?

    These are my settings in autoexec.bat:
    SET PATH=C:\PROGRA~1\ABRIAS~1\ABRIAS~1\PERL\BIN;%PATH%;
    SET JAVA_HOME=C:\jdk1.3.1
    SET TOMCAT_HOME=C:\Tomcat3.2.3
    SET CLASSPATH=C:\mm.mysql.jdbc-1.2b;%CLASSPATH%;
    Well, i'm quite new to jsp so i'm not sure what u meant by "In the servlet container's init scripts?". I onli did the settings above and reset my server.
    I've tried checking the dir...and yes there's a dir named org.
    Any ideas wat can possibly be wrong???

  • Servlet with Issues writing to MySQL Database using JNDI

    I'm hung on one servlet for my site. It compiles fine, and is accessed fine by the JSP, but doesn't do as I intended: write my blog entries to the MySQL database!
    As mentioned in the title, I'm using JNDI for connection pooling, via META-INF/context.xml.
    I'm also using JDBC Realm with a form, and that's working just fine, so I'm sure my issue isn't context.xml, as it seems to be overriding Tomcat's context file just fine, at least for authentication.
    Below is the code from the servlet, to include the annotations:
    package projectEgress.web.blog;
    import java.io.*;
    import java.text.*;
    import java.sql.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.*;
    public final class blogInput {
         /* bean properties */
        private String blogHeader;
        private String blogSubheader;
        private String blogBody;
        private String externalLinks;
        Connection conn;
        Statement stmt;
            /* getters & setters */
            public String getBlogHeader() {
                return blogHeader;
            public void setBlogHeader(String blogHeader) {
                this.blogHeader = blogHeader;
            public String getBlogSubheader() {
                return blogSubheader;
            public void setBlogSubheader(String blogSubheader) {
                this.blogSubheader = blogSubheader;
            public String getBlogBody() {
                return blogBody;
            public void setBlogBody(String blogBody) {
                this.blogBody = blogBody;
            public String getExternalLinks() {
                return externalLinks;
            public void setExternalLinks(String externalLinks) {
                this.externalLinks = externalLinks;
            /* like it says, a void which writes to the database */
            public void writeToDatabase() {
                /* create the query string to fill the table */
                String query = "insert into blogEntry (blogHeader, blogSubheader, blogBody, externalLinks) values (\"" + this.blogHeader + "\", \"" + this.blogSubheader + "\", \"" + this.blogBody + "\", \""  + this.externalLinks + "\")";
                try {
                    /*establish the datasource and make the connection */
                    Context ctxt =  new InitialContext();
                    DataSource dsrc = (DataSource)ctxt.lookup("java:comp/env/jdbc/projectEgress");
                    conn = dsrc.getConnection();
                    stmt = conn.createStatement();
                    /* Add data to table 'blogEntry' in our database */
                    int input = stmt.executeUpdate(query);
                    /* close the connections */
                    stmt.close();
                    conn.close();
                    /* check for exceptions, ensure connections are closed */
                    } catch (SQLException sqlx) {
                        sqlx.printStackTrace();
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    } finally {
                        if (stmt != null) {
                            try {
                                stmt.close();
                        } catch (SQLException sqlx) {}
                        if (conn != null) {
                            try {
                                conn.close();
                        } catch (SQLException sqlx) {}
            Here are the settings I have in META-INF/context.xml (sans Realm stuff, which works):
    <Context debug="1" reloadable="true">
        <Resource name="jdbc/projectEgress"
            auth="Container"
            type="javax.sql.DataSource"
            username="********"
            password="********"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/projectEgress?autoReconnect=true"
            validationQuery="select 1"
            maxActive="15"
            maxIdle="8"
            removeAbandoned="true"
            removeAbandonedTimeout="120" />
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
        <WatchedResource>META-INF/context.xml</WatchedResource>
    </Context>And, finally, the code I'm using in the JSP which calls the method (the form action is directed to this file's URL):
        <jsp:useBean id="blogInput" class="projectEgress.web.blog.blogInput">
        <jsp:setProperty name="blogInput" property="*" />
            <jsp:scriptlet>blogInput.writeToDatabase();</jsp:scriptlet>
        </jsp:useBean>
        -YES, I know I'm using a scriptlet in a JSP... I really don't want to create a custom tag to call the method, at least not until I'm far along enough in the project to justify creating a library... let's make it all work, first! :o)
    FINALLY, the form:
    <form action="/projectEgress/area51/blogInput" method="post" id="adminForm" enctype="application/x-www-form-urlencoded">
         <div>
            <span class="inputheader">Blog Header</span><br />
          <input type="text" name="blogHeader" size="35" class="form" /><br />
            <span class="inputheader">Blog SubHeader</span><br />
          <input type="text" name="blogSubheader" size="45" class="form" /><br />
            <span class="inputheader">Blog Body</span><br />
          <textarea class="content" name="blogBody" rows="9" cols="60"></textarea><br />
            <span class="inputheader">External Links</span><br />
          <input type="text" name="externalLinks" size="45" class="form" /><br />
          <input type="submit" value="Post!" class="submit" />
         </div>
        </form>As far as I can tell, it should work, and it doesn't throw any errors (in fact it shows the success message rather than the configured error page), but when I check the blogEntry table from the MySQL prompt, it responds with "Empty set".
    I've double checked to ensure that the table columns are present in MySQL and all the naming conventions line up and they do, so I figure it's my servlet that's broken.
    Advice? Ideas?
    Thanks in advance.
    Edited by: -Antonio on Apr 25, 2008 8:03 PM with additional info

    Okay, I changed a few things in the servlet code.
    For one, I'm trying a PreparedStatement in place of Statement. Don't ask me what made me think it would work any better, it just stores the sql query in cache, but I thought I'd just try something else.
    One thing this is allowing me to do is make the connection and statement (now PreparedStatement pStmt) objects local variables. It wouldn't allow me to do so before without giving me compile errors.
    package projectEgress.web.blog;
    import java.io.*;
    import java.text.*;
    import java.sql.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.*;
    public final class blogInput {
         /* bean properties */
        private String blogHeader;
        private String blogSubheader;
        private String blogBody;
        private String externalLinks;
            /* getters & setters */
            public String getBlogHeader() {
                return blogHeader;
            public void setBlogHeader(String blogHeader) {
                this.blogHeader = blogHeader;
            public String getBlogSubheader() {
                return blogSubheader;
            public void setBlogSubheader(String blogSubheader) {
                this.blogSubheader = blogSubheader;
            public String getBlogBody() {
                return blogBody;
            public void setBlogBody(String blogBody) {
                this.blogBody = blogBody;
            public String getExternalLinks() {
                return externalLinks;
            public void setExternalLinks(String externalLinks) {
                this.externalLinks = externalLinks;
            /* like it says, a void which writes to the database */
            public synchronized void writeToDatabase() {
                Connection conn = null;
                PreparedStatement pStmt = null;
                /* create the query string to fill the table */
                String Query = "INSERT INTO blogEntry (blogHeader, blogSubheader, blogBody, externalLinks) VALUES (\"" + this.blogHeader + "\", \"" + this.blogSubheader + "\", \"" + this.blogBody + "\", \""  + this.externalLinks + "\")";
                try {
                    /*establish the datasource and make the connection */
                    Context ctxt =  new InitialContext();
                    DataSource dsrc = (DataSource)ctxt.lookup("java:comp/env/jdbc/projectEgress");
                    conn = dsrc.getConnection();
                    pStmt = conn.prepareStatement(Query);
                    /* Add data to table 'blogEntry' in our database */
                    pStmt.executeUpdate();
                    pStmt.clearParameters();
                    /* close the connections */
                    pStmt.close();
                    conn.close();
                    /* check for exceptions, ensure connections are closed */
                    } catch (SQLException sqlx) {
                        sqlx.printStackTrace();
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    } finally {
                        if (pStmt != null) {
                            try {
                                pStmt.close();
                        } catch (SQLException sqlx) {}
                        if (conn != null) {
                            try {
                                conn.close();
                        } catch (SQLException sqlx) {}
    }Someone out there has to have a thought on this.
    Even if it's just something they think probably won't work, so long as it gives me another angle to see this from.

  • How to connect to mysql database using a proxy

    Folks,
    I wrote a program to connect to both webpage and mysql databases. Because my internet has a firewall (proxy) I set up the internet connection like this:
          System.getProperties().put( "proxySet", "true" );
          System.getProperties().put( "proxyHost", proxyHost);
          System.getProperties().put( "proxyPort", proxyPort);
          Authenticator.setDefault(new MyAuthenticator());The http connection works fine. However the mysql database connection gives me an error:
    com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.net.ConnectException: Connection timed out: connect
    STACKTRACE:
    java.net.SocketException: java.net.ConnectException: Connection timed out: connect
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)
            at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at myapplication$LongTask$ActualTask.<init>(app.java:182)
            at myapplication$LongTask$1.construct(app.java:121)
            at myapplication.SwingWorker$2.run(SwingWorker.java:107)
            at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION ** What can I do? Do i need to setup a SOCKS Proxies or something?
    Thanks a lot!!

    SOCKS it is.

  • Error connecting to portal database using alias

    i am using Connector framework api to connect to portal database.
    in <b>visual administrator -> JDBC connector</b>. I click on <b>runtime</b> tab
    Under <b>Resources</b> i find <b>Data Sources</b> and <b>Drivers</b>.
    Under Data sources I see SAPSR3DB. In Main tab on right hand pane I find many other aliases called SAP/BC_UME and SAP/BC_WDDR etc. Which one do I use in creating a connection.
    IConnectorGatewayService cgService = (IConnectorGatewayService) PortalRuntime.getRuntimeResources().getService("com.sap.portal.ivs.connectorservice.connector");
    ConnectionProperties cp = new ConnectionProperties(request.getLocale(),request.getUser());
    IConnection connection = cgService.getConnection("SAPSR3DB",cp);
    No system found for alias SAPSR3DB.

    Hi,
    If you want to use the PortalService IConnectorGatewayService you will have to create a JDBC System in the System Landscape of the Portal and create a System Alias with usermapping.
    You can then create a c connection to this JDBC System with the IConnectorGatewayServcie using the specified System alias.
    But if you want to directly connect to the System Database you can also use OpenSQL in your Portalapplication and lookup the Connection using JNDI:
          InitialContext ctx= new InitialContext();
          ds= (DataSource) ctx.lookup("jdbc/SAPSR3DB");
          java.sql.Connection conn= ds.getConnection();
    // user your connection here and close all jdbc objects finally!
    Best regards,
    Stefan Brauneis

  • 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

  • Help with connection to mysql database, Getting error : No suitable Driver

    Below is my code :
    1) i have added the mysql driver (mm.mysql-2.0.14-bin.jar)in my classpath
    2) the code is getting compiling properly
    3) while running it using tomcat, it says "NO SUITABLE DRIVER"
    PLEASE HELP !!
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class logincheck extends HttpServlet {
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws IOException, ServletException
    Connection con = null;
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    PreparedStatement stmt = null;
    ResultSet rs = null;
    String userid = request.getParameter("userid");
    String password = request.getParameter("password");
    try {
    /** LOADING THE DRIVER FOR MYSQL DATABASE ***/
    Class.forName ("org.gjt.mm.mysql.Driver";
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    } //End of try-catch 1
    try{
         /*** CONNECTING TO THE DATABASE USING DATABASE NAME, USERNAME AND PASSWORD */
    con = DriverManager.getConnection("jdbc:mysql://localhost:8080/own");
    /****** this checks whether the entry for the user is in the database *****/
    stmt = con.prepareStatement("SELECT *FROM userinfo WHERE userid = ? AND passwd = ?");
    stmt.setString(1,userid);
    stmt.setString(2,password);
    rs = stmt.executeQuery();
    if(!rs.next())
    else
         /****************** IF THE USER AND PASSWORD ARE VALID *****************/
    //} // END OF RS.....
    // NEED HTML FOR INVALID USERID SHOWING MESSAGE ...
    con.close();
    }catch(SQLException esql){
    System.out.println(esql.getMessage());
    } // End of try-catch 2
    } // goGet
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws IOException, ServletException {
    doGet(request, response);
    } // goPost
    } // end logincheck function ...

    And i see another thing that confuses me. Your URL connection string is
    con = DriverManager.getConnection("jdbc:mysql://localhost:8080/own"); meaning that your database is in your machine and listens in port 8080 for incoming connections. But that is the default port that Tomcat listens! Maybe you should change this line to
    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/own");where 3306 is MySQL's default port.
    Hope these help.

  • Not able to connect to remote MySQL database using Connector/J

    I have an application that uses a connection pool for database access.
    It is initialized with this context.xml entry:
    The db server is running on port 3307.
         <Resource name="jdbc/DB" auth="Container"
                        type="javax.sql.DataSource" username="un" password="pw"
                        removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
                        driverClassName="com.mysql.jdbc.Driver"
                        url="jdbc:mysql://localhost:3307/myDB"
                        maxActive="8" maxIdle="4"/>Now after starting the context, I can see I have a connection to my database using the MySQL Administrator. So I know I am connecting.
    The problem is, when I try to query any table in the db, I get this message:
    java.sql.SQLException
    : Table myDB.TABLE_NAME' doesn't exist
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(
    MysqlIO.java:2921) ...
    I know it does in fact exist because I am looking at it. And the code I am using works perfectly fine as long as it is running on a local db server.
    Any ideas?

    I know it does in fact exist because I am looking at
    it. And the code I am using works perfectly fine as
    long as it is running on a local db server.
    Any ideas?Yes two.
    I am bit unclear about the last thing you said... you are testing with two different servers or two different clients?
    Anyway here are the possibilities off the top of my head.
    1) Some sort of security issue. Surrounding who and from where users can connect to the database in question.
    2) Case sensitivity problem. On Windows MYSQl makes all it's table names lower case only. Then it onlu supports the correct case to access them.
    For example
    CREATE TABLE TestMe
    Can then only be accessed with
    SELECT * FROM testme
    Not TestMe.
    This appears to vary with version but i have seen this issue before.

  • How to connect mysql database using xml

    welcome to all,
    here my doubt is how to connect mysql database using xml file, how to integrate xml file and jsp file and how to access data from dabase using jsp file. can any one help me
    regards

    Short answer: you wouldn't do any of those things. The first two are meaningless and the third is a bad practice. I have no idea what those ideas were supposed to achieve so I have no idea what tutorials I should suggest to you.

  • Error: OGG-00146 - error 600 - Failed to connect to mysql database

    Dear All,
    I am replicating Data from MySQL to Oracle.
    Version of my MySQL is Server version: 5.5.19 MySQL Enterprise Server - Advanced Edition
    Version of Oracle is : Oracle 11gR2
    My extract is giving the following error and I am unable to identify the problem:
    *2012-12-25 14:18:48 ERROR OGG-00146 Oracle GoldenGate Capture for MySQL, netfors.prm: VAM function VAMInitialize returned unexpected result:*
    error 600 - VAM Client Report <CAUSE OF FAILURE : Failed to connect to mysql database WHEN FAILED : While initializing mysql context WHERE FAILED :
    MySQLBinLog Reader Module CONTEXT OF FAILURE : No Information Available!>
    Following are the contents of my /etc/odbc.ini file
    *[netfors]*
    Driver = /usr/lib/libmyodbc3.so
    Description = Connector/ODBC 3.51 Driver DSN
    Server = 10.168.20.226
    Port = 6629
    User = replication
    Password = ******
    Database = netfors
    Option = 3
    Socket = /tmp/mysql_sandbox5519.sock
    When i isql -v netfors replication ***** *
    it say Connected!
    This is my extract:
    EXTRACT NETFORS
    DBOPTIONS HOST 10.168.20.226, CONNECTIONPORT 6629
    SOURCEDB [email protected]:6629, USERID replication, PASSWORD ******
    RMTHOST 10.168.20.31, MGRPORT 7809
    RMTTRAIL /u01/app/oracle/oradata/GG/dirdat/n1
    TRANLOGOPTIONS ALTLOGDEST /root/sandboxes/msb_5_5_19/data/mysql-bin.index
    TABLE netfors.syslog;
    Extract gets ABENDED
    Kindly help on this.
    Regards, Imran

    Got it solved some how, golden gate was trying to connect with default socket file.
    */tmp/mysql.sock*
    while my socket file was
    */tmp/mysql_sandbox5519.sock*
    I changed it to default and got rid of the error.
    Thanks for the help.
    Regards, Imran

  • I can't connect to MySQL database from The JSP Standard Tag Library

    Hi All !
    I have a problem, please help me anybody !
    I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
    I have in folder�WEB-INF/lib� following files:
    antlr.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    mysql-connector-java-3.1.13-bin.jar
    standard.jar
    struts.jar
    I'm using:
    NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
    Ent.Pack 20061020 Visual Wb Pack 061103
    OS WinXP SP2
    Java 1.5.0_10
    MySQL 5.0.18-nt
    1:<%@page contentType="text/html"%>
    2:<%@page pageEncoding="UTF-8"%>
    8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
    10:
    11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    12: "http://www.w3.org/TR/html4/loose.dtd">
    13:
    14: <sql:setDataSource var="ds"
    15: driver="com.mysql.jdbc.Driver"
    16: url="jdbc:mysql://localhost:3306/test"
    17: user="root"
    18: password="xxxx"/>
    19:
    20:
    21:<sql:query sql="select name, age from People" var="res"
    22: dataSource="${ds}"/>
    I have received report on mistake when entered code at the top:
    �/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
    I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
    After build and run I have received
    =========================================START=================================
    HTTP Status 500
    type Exception report:
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17
    =======================================END================================
    Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
    BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
    I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
    I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
    There is idea how can resolve this problem
    Thank you in advance ;)

    For all how have similar problem.
    Decision instead of these ways
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    it is necessary to indicate these
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

  • Connecting to MySQL Database with Servlet

    Hi All,
    I want to connect to MySQL Database from servlet.
    I am using Tomcat websever 3.3.1, where i have to set classpath of mysql jdbc driver.
    I tried by copying mysql jdbc driver in so many directiories of Tomcat server but it is
    giving me error like "no specified driver find"
    So please send me all the solutions and how to set the classpath to connect to
    mysql database.
    Thanks

    U r correct that so many people are giving me solutions but that are not working for me
    I think i not correct in setting the classapath to mysql jdbc driver.
    1)I have unjarred correctly and all the classes are present in that.
    yes driver class is there in that .
    2)Now i am using new version of the mysqljdbc that is 2.0.13
    If now any driver after this send me url i will download it and use it
    3)I am unable to under stand what is yourcontext in
    yourcontext/web-inf/lib?
    This is my directory structure.
    c:tomcat in this i have
    bin
    conf
    doc
    lib
    logs
    modules
    native
    webapps
    work
    in bin there are no subdirectories
    in conf i have
    auto,jserv,jk,users
    in doc i have
    appdev,images
    sample( in appdev)
    etc,lib,src,web(in sample)
    images(in sample\web)
    in lib i have
    apps
    common
    container(c:\tomcat\lib)
    in logs,modules there are no subdirectories
    in native (c:\tomcat\native) i have
    mod_jk
    mod_jserv
    in mod_jk i have
    apache 1.3
    common
    iis
    jni
    netscape
    nt_service
    in webapps i have (c:tomcat\webapps)
    Admin,Examples,root
    in Admin i have (c:\tomcat\webapps\admin)
    contextadmin
    Meta-inf
    Test
    Web-inf
    in web-inf (c:\tomcat\webapps\admin\web-inf)
    Classes,lib,script
    in classes i have (c:\tomcat\webapps\admin\web-inf\classes)
    tadm
    in examples (c:\tomcat\webapps\examples) i have
    Images,Jsp,Meta-inf,Servlets,Web-inf
    in web-inf (c:\tomcat\webapps\examples\web-inf) i have
         Classes,jsp
    in classed (c:\tomcat\webapps\examplesweb-inf\classes) i have
    Cal
    Checkbox
    Colors
    Dates
    Error
    Examples
    Num
    Sessions
    in jsp (c:\tomcat\webapps\examples\web-inf\jsp) i have
    applet          
    I think this is enough to give correct answer for me .
    Thanks

Maybe you are looking for

  • Goods Return does not work in some instances

    We are on SRM Server 550 SP4 ECS There two Return codes which are giving error   Reason for Return - Goods not ordered      Error Msg: Reason for Mvmt 004 not supported (Check your entry)   Reason for Return - Goods Delivered Twice     Error Msg: Rea

  • Very urgent !! Doc. types & Doc. no ranges in different views in ECC 6.0

    Hello Experts, Can someone tell me the difference between Defining Document Types for Entry View Defining Document Types for Entry View in a Ledger Defining Document Types for General Ledger View? in ECC 6.0. Also should we assign different number ra

  • Sending Alert in mail?

    Hi All, I have created the Alert category, Alert rules and I have added my name in SU01, but still iam not able to get the mails when any error occures in the scenario IDOC to File. If aimk missing any setting that need to be done please let me know.

  • ABAP Dump - Time out

    I need to work out on a report that is continuously throwing Runtime error of Time Out. After debugging, i realised that its running in a Loop infinitely. And i suppose that would be causing timeout. Could anyone suggest a way to deal with such error

  • Polling adapters with additiona dialog instances?

    Hi, I have a question regarding the behavior of polling adapters, i.e. FTP adapter,  when you install additional dialog instances for the central AE. If the Central AE runs in two cluster nodes what is the behavior of a ftp sending adapter? I guess