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

Similar Messages

  • 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]

  • 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

  • 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 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???

  • 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

  • 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.

  • 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" %>

  • 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.

  • 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

  • CONNECTING TO MySql DATABASE FROM Jdeveloper

    Hi,
    How can i connect to MySql database form Oracle Jdeveloper version 11.1.2.0.0.
    I was trying to create connection using create database connection dialog box but it is giving this error:
    Test failed: Driver class not found.
    Verify the Driver location
    Please can I get step by step procedure on how to create this connection.
    Thanks.

    Connect JDeveloper to a MySQL database - YouTube
    http://people.cis.ksu.edu/~hankley/d764/tut06/Ross_mySQL/mySQL.htm
    Hil &amp;amp; Co IT Solutions: Connecting to MySQL in JDeveloper

  • 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.
    %

  • Cs3 connect to mysql database

    hi,
    i am having problems with my xp machine running cs3. when i try to connect to mysql database it throws back http error code 405 method not allowed.
    i downloaded the script replacement files after googling however that still never resolved the issue. can anyone help?
    many thanks

    This may, or may not, help...
    For those using MySQL - Installing PHP and MySQL on Windows
    XP
    http://www.webassist.com/professional/products/solutionrecipes.asp

  • Cannot connect to MySQL database

    Hi
    I'm new to flex builder 3... and have therefore looked at
    lynda.com to learn about the product and get started fast. And here
    they show you how to create a connection to a MySQL database using
    MAMP on a mac (or WAMP on the PC) - I'm on the mac ;-).
    I have installed the MAMP server with both MySQL, Apache and
    PHP running on defalt ports. And I have created a simple database
    in MySQL... The site is running fine and so is the MySQL (I have
    tested with simple HTML etc)... but when I try to connect to the
    database using the wizard in Flex, I get the following message:
    Unable to connect to the database....
    If I look at the details it say (hold on):
    com.mysql.jdbc.CommunicationsException: Communications link
    failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.net.NoRouteToHostException: No route to host
    STACKTRACE:
    java.net.SocketException: java.net.NoRouteToHostException: No
    route to host
    at
    com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
    at
    com.mysql.jdbc.Connection.createNewIO(Connection.java:2555)
    at
    com.mysql.jdbc.Connection.<init>(Connection.java:1485)
    at
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    at
    org.eclipse.datatools.connectivity.db.generic.JDBCConnection.createConnection(JDBCConnect ion.java:87)
    at
    org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverCo nnectionBase.java:104)
    at
    org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:53 )
    at
    org.eclipse.datatools.connectivity.db.generic.JDBCConnectionFactory.createConnection(JDBC ConnectionFactory.java:52)
    at
    org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(Co nnectionFactoryProvider.java:77)
    at
    org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(Connection Profile.java:354)
    at
    com.adobe.datatools.derived.wizards.BaseConnectionProfilePage.testConnectionSimple(BaseCo nnectionProfilePage.java:70)
    at
    com.adobe.datatools.derived.wizards.BaseConnectionProfilePage.testConnection(BaseConnecti onProfilePage.java:51)
    at
    org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage$1.widgetSelect ed(ConnectionProfileDetailsPage.java:85)
    at
    org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
    at
    org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1495)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1519)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1504)
    at
    org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1295)
    at
    org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3350)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2954)
    at
    org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at
    com.adobe.flexbuilder.dbwizard.ui.DbWizard$8.widgetSelected(DbWizard.java:598)
    at
    org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
    at
    org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1495)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1519)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1504)
    at
    org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1295)
    at
    org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3350)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2954)
    at
    org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at
    com.adobe.flexbuilder.dbwizard.actions.DBWizardAction.run(DBWizardAction.java:69)
    at
    org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)
    at
    org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
    at
    org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionI tem.java:546)
    at
    org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
    at
    org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java :402)
    at
    org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1495)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1519)
    at
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1504)
    at
    org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1295)
    at
    org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3350)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2954)
    at
    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
    at
    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
    at
    org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
    at
    org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
    at
    org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
    at
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
    at
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at
    com.adobe.flexbuilder.standalone.FlexBuilderApplication.start(FlexBuilderApplication.java :112)
    at
    org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:106)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:76)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
    ** END NESTED EXCEPTION **
    .... and more ...
    What the h.. does that mean - Plz advice someoone ... I'm
    really stock here ;-(
    Kind regards
    Brian

    Thanks for the answer, but I must be doing something very
    wrong - as I still havn't found the correct solution ;-(
    I have as mentioned tried both the default MySQL port (3306)
    and the one used by MAMP (8889) but without any luck.
    I do restart the MySQL server each time - and MAMP even does
    that by default when changing the port number.
    If I open myphpadmin the DB is running and as told I can
    connect to it using Dreamwaever...
    But If I run the command "telnet localhost 8889" you told my
    to, in terminal I get the following message:
    Trying ::1...
    telnet: connect to address ::1: Connection refused
    Trying fe80::1...
    telnet: connect to address fe80::1: Connection refused
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    telnet: Unable to connect to remote host
    So here it looks as if I can't connect ??? The same happens
    if I try the default port 3306.
    Everytime I test in the wizard I get the message:
    com.mysql.jdbc.CommunicationsException: Communications link
    failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.net.NoRouteToHostException: No route to host
    STACKTRACE:
    java.net.SocketException: java.net.NoRouteToHostException: No
    route to host
    at
    com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:....
    etc
    And yes it is the Data -> Create Application from Database
    wizard that I'm trying to use.
    I don't undersatnd why the lynda.com video tell that it is
    important to change the MAMP's settings to the default port instead
    of using the MAMP ports, when you say it is not like that ? They
    even show how to disable the default Apache webserver to use the
    MAMP one on port 80.
    Hope the terminal message can give someone a hint to the
    posible problem.
    Thanks in advance

Maybe you are looking for

  • One account for two iPads, different content

    Hello everyone. I've got a question - I recently bought an iPad2 in addition to my first iPad, and I'm wondering if it is possible to use the same account (and the same PC) for both iPads, while having a different set of apps, photos, music and other

  • Notes, grumblings and Questions on MP3-players in gene

    . A failing of (as far as I know) any MP3 recorder (if an MP3 player can record MP3s, I call it an MP3 recorder) are all those missing editing options available on MiniDisk: divide, combine, name and move tracks. Since fragmenting is of hardly any im

  • New files dont play in iTunes , older files work fine!!! ????

    Hi. I just finished a new project in Logic Pro 7.1 and bounced it as usual. The wave file wont play on iTunes. I cheked previous bounced files and they play just fine. Also if i drag and drop this file in iTunes , nothing happens whereas files from p

  • 32 bit app not working

    I had the photo browser app ACDSee running fine in Lion. I've upgraded to Mavericks and it no longer works. I click on the app in launchpad and it starts but disappears about a second later. I've gone to 'file info' and found there is no checkbox opt

  • A/V page does not open

    I loaded itunes8 pro and installed mpg2 playback but now have no sound. Under windows the A/V section does not opne. Please help/