MYSQL 5.0 connection

i had follow the instruction
Note: Connector/J version 3.1.11 and higher cannot be used
with ColdFusion MX 7 because of MySQL bug 13469. Connector/J 3.1.10
should be used instead for ColdFusion MX 7 until this MySQL bug is
fixed. All -Connector/J version 3.0 releases and all version 3.2
releases work with ColdFusion MX 7.
-Extract the mysql-connector-java-3.{n}-bin.jar file from the
downloaded archive file.
-Save the mysql-connector-java-3.{n}-bin.jar file in the
cf_root/WEB-INF/lib directory.
-Restart the ColdFusion MX server.
-Add a new data source to the ColdFusion MX Administrator,
using the driver option Other.
-Enter the JDBC URL: jdbc:mysql://[host]:[port]/[database]
-Enter the Driver Class: com.mysql.jdbc.Driver
-Complete username/password, and adjust other data source
settings, if needed.
-.Submit the data source for verification.
but still got error occurs :
データソース用の接続確認に失敗しました:
hm_account
java.sql.SQLException: Cannot connect to MySQL server on
hm:3306. Is there a MySQL server running on the machine/port you
are trying to connect to? (java.net.UnknownHostException)
ルート原因
:java.sql.SQLException: Cannot connect to MySQL server on hm:3306.
Is there a MySQL server running on the machine/port you are trying
to connect to? (java.net.UnknownHostException)

the newest driver works with 5+... 3.1.13
and that previous bug has been fixed in the 3.1.13 driver. I
use the
latest driver for connections to 4.0, 4.1 & 5.0 on my dev
box.
As BKBK suggested, make sure MySQL is running, no firewall
issues, port
number is correct, etc.
HTH,
Tim Carley
www.recfusion.com
[email protected]

Similar Messages

  • Performance with MySQL and Database connectivity toolbox

    Hi!
    I'm having quite some problems with the performance of MySQL and Database connectivity toolbox. However, I'm very happy with the ease of using database connectivity toolbox. The background is:
    I have 61 variables (ints and floats) which I would like to save in the MySQL-database. This is no problem, however, the loop time increases from 8ms to 50ms when using the database. I have concluded that it has to do with the DB Tools Insert Data.vi and I think that I have some kind of performance issue with this VI. The CPU never reach more the 15% of its maximum performance. I use a default setup and connect through ODBC.
    My questions are:
    1. I would like to save 61 variables each 8-10ms, is this impossible using this solution?
    2. Is there any way of increasing the performance of the DB Tools Insert Data.vi or use any other VI?
    3. Is there any way of adjusting the MySQL setup to achieve better performance?
    Thank you very much for your time.
    Regards,
    Mattias

    First of all, thank you very much for your time. All of you have been really good support to me.
    >> Is your database on a different computer?  Does your loop execute 61 times? 
    Database is on the same computer as the MySQL server.
    The loop saves 61 values at once to the database, in one SQL-statement.
    I have now added the front panel and block diagram for my test-VI. I have implemented the queue system and separate loops for producer and consumer. However, since the queue is building up faster then the consumer loop consumes values, the queue is building up quite fast and the disc starts working.
    The test database table that I add data to is created by a simple:
    create table test(aa int, bb char(15));
    ...I'm sure that this can be improved in some way.
    I always open and close the connection to the database "outside the loop". However, it still takes some 40-50 ms to save the data to the database table - so, unfortunatly no progress to far. I currently just want to save the data.
    Any more advise will be gratefully accepted.
    Regards,
    Mattias
    Message Edited by mattias@hv on 10-23-2007 07:50 AM
    Attachments:
    front panel 2.JPG ‏101 KB
    block diagram.JPG ‏135 KB

  • MySql: faint of connect

    Dear Sir:
    I am in w2kp and jdk1.3.1 and study JDBC.
    MySql 3.23.49-nt and mysql-2.0.11-bin.jar--JDBCDriver
    ---------while I use
    C:\java CreateCoffees
    ----------sometime I got
    SQLException: Communication link failure: java.net.SocketException
    why? sometime I could create it. (I use Drop table coffees to delete it and test my code again,
    I got "SQLException: General error: Table 'coffees' already exists" if I did not drop)
    My question is " how could I confirm that I could connect it at any time by reedit the java file or configure the mysql".
    thank you a lot.
    ***********************CreateCoffees.java********************
    import java.sql.*;
    public class CreateCoffees {
    public static void main(String args[]) {
    //String url = "jdbc:mySubprotocol:myDataSource";
    String url = "jdbc:mysql://localhost/COFFEEBREAK";
    Connection con;
    String createString;
    createString = "create table COFFEES " +
    "(COF_NAME VARCHAR(32), " +
    "SUP_ID INTEGER, " +
    "PRICE FLOAT, " +
    "SALES INTEGER, " +
    "TOTAL INTEGER)";
    Statement stmt;
    try {
    Class.forName("org.gjt.mm.mysql.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, "", "");
    stmt = con.createStatement();
    stmt.executeUpdate(createString);
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());

    Hi,
    You're wrong , lots of people including myself use mysql (some of the time) - unfortunatly, we are not always checking the java forum pages.
    I haven't followed this thread properly, as it lacks soe of the info required, e.g the error produced when connecting,
    If you have the jar files set up corectly, and they are the earlier versions, then there should not be a problem. If you have upgraaded to a recent version then let me kow as there are differences in the build.
    I'll watch this topic, and offer advice as required.
    best
    kev

  • MySQL can't connect

    mysql unable to connect; MySQL said: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)

    after that I get this:
    Administrators-Mac-mini:~ administrator$ mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    Administrators-Mac-mini:~ administrator$
    I did not uninstall & start over, just this part:
    Create a launchd config file for MySQL:
    sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist
    Use the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>com.mysql.mysqld</string>
        <key>ProgramArguments</key>
        <array>
        <string>/usr/local/mysql/bin/mysqld_safe</string>
        <string>--user=mysql</string>
        </array>
      </dict>
    </plist>
    (if you are new to vi, type 'i' to enter insert mode. Then ⌘-v to paste the above content. Press escape to get back to command mode. Then type 'ZZ' to save and exit.)
    The default path for the MySQL socket is not appropriate for MacOS X. Until it is changed, MySQL will not be able to communicate with PHP should you choose to enable that. Let's fix this now.
    Create a config file for MySQL that matches the Apple PHP build:
    sudo vi /etc/my.cnf
    Use the following content:
    [client]
    socket=/var/mysql/mysql.sock
    [mysqld]
    socket=/var/mysql/mysql.sock
    Start MySQL:
    sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
    Still No Joy.
    Nav

  • OpenOffice Base - MySQL with JDBC connection

    I was using MySQL with ODBC connection, but cannot do all MySQL queries. In OO Forum says dev version does with JDBC.
    http://www.oooforum.org/forum/viewtopic.phtml?t=41301
    I am now using OpenOffice dev version. I am a bit lost when asked to install MySQL JDBC Driver Class:
    com.mysql.jdbc.Driver
    Is the driver a part of jre package or to be installed from somewhere?

    I downloaded, but don't know where and how to install or use it. Took a look at the documentation, seems it requires only to untar but something has to be pointed. I think its something simple but I am overlooking.
    EDIT
    This thread tells how to do...
    http://www.oooforum.org/forum/viewtopic.phtml?t=33199

  • MySQL to DreamWeaver connectivity issue specific to Stored Procedures

    Hi there,
    I have a MySQL to DreamWeaver connectivity issue specific to
    Stored Procedures.
    The driver I am currently using is
    mysql-connector-java-5.1.5-bin.jar.
    Although basic row and column tree is exposed in Adobe
    DreamWeaver 8's Application Pallette, my stored procedure is not.
    My serverside technology is Coldfusion(MX7).
    My environment is:
    Server: MS Windows 2003 (Small Business Server) using IIS.
    Client: MS Window XP-Pro.
    According to the driver documentation
    mysql-connector-java-5.1.5-bin.jar appears to be capable of
    handling stored procedures:
    http://dev.mysql.com/doc/refman/5.1/en/connector-j-useagenotes-basic.html#connector-j-exam ples-stored-procedure
    I could be wrong but the evidence suggests that support for
    this feature is not available from Adobe.
    I have already invested a certain amount of time in this
    sub-project. I would, therefore, be most grateful to anyone who can
    provide me with a solution to this.

    OK.
    Figured out the 'stored proceedure' problem. I had two 'Connection' folders, one of which was a sub-folder, that pointed to the same database but with slightly different configuration details. Removed the 'wrong' folder and all seems to be sorted.
    P

  • Mysql-jdbc applet connection issue

    I am developing a user interface for a mysql database. I am able to successfully access the db and execute queries through a java APPLICATION.
    I need to do the same (access the db (mysql)) through a java APPLET. When I compile the applet it complies fine. When I try to run the applet I'm getting the following error message:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I tied running the applet using appletviewer and through a web browser, same result. I can run the application from the same command prompt it works fine.
    Please help.
    Relevant info:
    OS: Linux, Fedora4
    Classpath: export set CLASSPATH=/home/xyz/Java/mysql-connector-java-5.0.5/:$CLASSPATH;
    JDK: PATH=/usr/java/jdk1.6.0/bin
    Program:
    import java.sql.*;
    public class b extends java.applet.Applet
         int y = 0;
    public void paint(java.awt.Graphics g)
              y = y + 10;
    Connection conn = null;
    String driver = "com.mysql.jdbc.Driver";     
    String url = "jdbc:mysql://localhost:3306/testdb?user=usr1234&password=xyzxyz";
    try {
         Class.forName(driver).newInstance();
         conn = DriverManager.getConnection(url);
         System.out.println("Connected to the database.");
         System.out.println(" ");
         //*********BLOCK TO RETRIEVE RECORDS FROM TABLE*********          
                   try{
                        Statement st = conn.createStatement();
                        ResultSet res = st.executeQuery("SELECT * FROM table1");
                        System.out.println("Name: " + "\t" + "Age: ");
                        while (res.next()) {
                             String s = res.getString("name");
                             int i = res.getInt("age");
                             System.out.println(s + "\t" + i);
                   catch (SQLException s){
              y = y + 20;
    g.drawString("******* s: "+s,50,y);
         //*********END OF BLOCK TO RETRIEVE RECORDS FROM TABLE*********          
         conn.close();
         System.out.println("Disconnected from database");
         }      catch (Exception e) {
              y = y + 20;
    g.drawString("******* e: "+e,50,y);
                   e.printStackTrace();
    Thanks for the help in advance.
    --Mat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    First, accessing a database from an applet is a horrendous idea.
    Having said that, did you add the mysql jar to the applet tag in the html page (in the archive property)?

  • Confused, which MySQL database to connect to: local (WAMP), or remote?

    Hello, new to dynamic sites, have successfully installed WAMP and set up my local/testing/remote sites in DW CS4.  Most tutorials I've found recommend making the "MySQL Connection" in Dreamweaver to the local (WAMP) installation of MySQL, which I am able to do.  But my remote site already has an existing MySQL database and tables.  So should I be making the MySQL Connection to the remote database instead?  Or exporting the remote server's database and importing it locally for development purposes?  What's the best practice?
    If making the connection to my local database is recommended, how do I transfer any changes that I make on my local db to the remote database?  Do I need to export locally & import to the remote db, using phpmyadmin, every time I make changes to the local database?
    If making the connection to my remote database is recommended, I have 2 questions: 1) do I even need my local WAMP MySQL database for anything?  and 2)  I was able to connect to my remote MySQL, (first got "MySQL ERROR 1045 Access Denied", but then went into my remote server via CPanel, found the "Remote MySQL" function, and entered my long current domain name as a new Access Host), but since I'm at a home office without a static IP, will I have to keep going into CPanel and entering in a new Access Host every time my IP address changes?
    Apologies for the confusion.  Any pointers to recommended best practices would be much appreciated.
    - Frank

    > 2)  I was able to connect to my remote MySQL, (first got "MySQL ERROR  1045
    > Access Denied", but then went into my remote server via CPanel,  found the
    > "Remote MySQL" function, and entered my long current domain  name as a new
    > Access Host), but since I'm at a home office without a static IP,
    > will I have to keep going into CPanel and entering in a new  Access Host every time
    > my IP address changes?
    Update: my IP address changed slightly yesterday and I was denied remote MySQL access again.  Went back to CPanel and modified my Access Host domain with a few wildcard characters (blah-blah-blah-%%%%.dsl.bell.ca).  That got me back in.  Is this what most people who want remote MySQL access do?  Is it a (significant) security risk?
    Or do most people without static IPs just not bother with remote MySQL access?

  • How to use SQL Dev with MySQL DBs ? Connection Setup

    As far as I know SQL Dev can be used with MySQL databases as well.
    How do I have to setup the connection for MySQL?
    In detail what do I have to enter for
    -role
    -connection type
    SID/ServiceName
    Or is there a separate version for Oracle and MySQLß
    Peter
    Edited by: user5328442 on Jan 5, 2011 9:23 AM

    Hi,
    After downloading the MySQL plugin did you add the details in the third party database list ?
    Do the following -
    - Tools
    - Preferences
    - expand the Database option if necessary
    - Third Party JDBC Drivers
    - add the location and file name of the plugin.
    On my setup it is -
    D:\mysql_jdbc\mysql-connector-java-5.0.8\mysql-connector-java-5.0.8-bin.jar
    The driver may be different if you have a later version.
    Regards,
    Mike
    Edited by: mkirtley on Jan 7, 2011 9:46 AM

  • MySql with JBoss connection refused

    hello,
    I am using MYSql with JBOSS, but while running starting JBOSS it
    gives
    Connection refused error:
    MySqlDB] at java.net.PlainSocketImpl.socketCon
    MySqlDB] at java.net.PlainSocketImpl.doConnect
    MySqlDB] at java.net.PlainSocketImpl.connectTo
    MySqlDB] at java.net.PlainSocketImpl.connect(U
    MySqlDB] at java.net.Socket.<init>(Unknown Sou
    MySqlDB] at java.net.Socket.<init>(Unknown Sou
    MySqlDB] at org.gjt.mm.mysql.MysqlIO.<init>(My
    MySqlDB] at org.gjt.mm.mysql.jdbc2.IO.<init>(I
    MySqlDB] at org.gjt.mm.mysql.jdbc2.Connection.
    159)
    MySqlDB] at org.gjt.mm.mysql.Connection.connec
    MySqlDB] at org.gjt.mm.mysql.jdbc2.Connection.
    va:89)
    MySqlDB] at org.gjt.mm.mysql.Driver.connect(Dr
    MySqlDB] at java.sql.DriverManager.getConnecti
    MySqlDB] at java.sql.DriverManager.getConnecti
    MySqlDB] at org.opentools.minerva.jdbc.xa.wrap
    nnection(XADataSourceImpl.java:118)
    MySqlDB] at org.opentools.minerva.jdbc.xa.wrap
    nnection(XADataSourceImpl.java:151)
    MySqlDB] at org.opentools.minerva.jdbc.xa.XACo
    (XAConnectionFactory.java:246)
    MySqlDB] at org.opentools.minerva.pool.ObjectP
    ol.java:819)
    MySqlDB] at org.opentools.minerva.pool.ObjectP
    a:569)
    MySqlDB] at org.opentools.minerva.pool.ObjectP
    a:521)
    MySqlDB] at org.opentools.minerva.jdbc.xa.XAPo
    APoolDataSource.java:165)
    MySqlDB] at org.jboss.jdbc.XADataSourceLoader.
    der.java:330)
    MySqlDB] at org.jboss.util.ServiceMBeanSupport
    ava:93)
    MySqlDB] at java.lang.reflect.Method.invoke(Na
    MySqlDB] at com.sun.management.jmx.MBeanServer
    java:1628)
    MySqlDB] at com.sun.management.jmx.MBeanServer
    java:1523)
    MySqlDB] at org.jboss.util.ServiceControl.star
    MySqlDB] at java.lang.reflect.Method.invoke(Na
    MySqlDB] at com.sun.management.jmx.MBeanServer
    java:1628)
    MySqlDB] at com.sun.management.jmx.MBeanServer
    java:1523)
    MySqlDB] at org.jboss.Main.<init>(Main.java:21
    MySqlDB] at org.jboss.Main$1.run(Main.java:121
    MySqlDB] at java.security.AccessController.doP
    MySqlDB] at org.jboss.Main.main(Main.java:117)
    I used the following tag in in JBOSS.jacml
    <!-- MYSQL -->
    <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=MySqlDB">
    <attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
    <attribute name="PoolName">MySqlDB</attribute>
    <attribute name="URL">jdbc:mysql://192.168.0.6/AccountingDb:3333</attribute>
    <attribute name="Properties">DatabaseName=AccountingDb</attribute>
    <attribute name="JDBCUser"></attribute>
    <attribute name="Password"></attribute>
    <attribute name="MinSize">0</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="GCEnabled">false</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    </mbean>
    <!-- END MYSQL -->
    and JDBC tag is
    <!-- JDBC -->
    <mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
    <attribute name="Drivers">org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,com.pervasive.jdbc.v2.Driver,org.gjt.mm.mysql.Driver</attribute>
    </mbean>
    plz help me out
    thanks
    bhuwan

    I am just use that ...But it works...!!
    MySQL is Runing good ...
    the problem is that you must reset the defaultDS,
    to be Mysql.
    So,Jboss must have only one DefaultDS,
    In My Setup...
    1.standardjaws.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <jaws>
    <datasource>java:/mySQL</datasource>
    2.jboss.jcml (must changed as followed)
    <!-- JDBC -->
    <mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
    <attribute name="Drivers">org.gjt.mm.mysql.Driver</attribute>
    </mbean>
    <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mySQL">
    <attribute name="PoolName">mySQL</attribute>
    <attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
    <attribute name="Properties"></attribute>
    <attribute name="URL">jdbc:mysql://localhost/j2ee</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser" />
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password" />
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
    </mbean>

  • MySQL can't connect through socket error

    I have been mucking around with MySQL and have broken something.
    Running 10.4.3 server, I get a "Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)" error
    Was working fine before I decided to mess with things - I think I altered the hostname from localhost to 192.168.x.x etc.
    Now I cannot connect, and MySQL manager won't start it. I would like to make it work again rather than have to install a different version.
    When MySQL manager installs the requisite files for the first time, where does it store these, and how can I do this again?
    Thanks
    Hamish

    There's an issue with authentication between PHP 5 and MySQL 4.1
    This thread should contain a resolution for you.
    http://discussions.apple.com/thread.jspa?messageID=665175&#665175
    FYI- A search here for "MySQL PHP socket" reveals the above thread and other threads with the same issue.
    Jeff

  • Define mysql and host connection only 1 place

    Hi everyone,
    For my school project i developed a application using servlets and jsp.
    In every servlet i make a new connection.
    Like this:
    public void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            System.out.println("MySQL Connect Example.");
            Connection conn = null;
            String url = "jdbc:mysql://127.0.0.1:3306/";
            String dbName = "cijfersysteem";
            String userName = "vishant";
            String password = "vishant";
            String driver = "com.mysql.jdbc.Driver";But if my host changes for example i need to change it in 10 or more files.
    that is not efficient.
    How can i make the connection in 1 file and require it over every other servlet?
    Thnx in advance for the help everyone.

    If you are using Tomcat or Jetty, you can define JNDI entries like this:
    [http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#JDBC%20Data%20Sources]
    [http://docs.codehaus.org/display/JETTY/JNDI]
    You should be using resource injection in Glassfish.

  • Mysql, transactions and connections

    Hi,
    I have two problems:
    1. I am using mysql 3.23 and JBuilder 6 and I would like to use transactions.
    I created a database and a table InnoDb and when I try from my application to setautocommit(false) I get the following error:
    See com.borland.dx.dataset.DataSetException error code: BASE+66
    com.borland.dx.dataset.DataSetException: Cannot disable AUTO_COMMIT
    I tried lots of things in the mysql server and in my application and I don't know wether it's a configuration of the server, something I need to set first in the WinMySqlAdmin or something I have to do in my application.
    I would really use some help.. If anyone could also provide a small example please..
    2. It's also related to Mysql
    I have a server that opens a connection to the database. I want to know what I have to set in the mysql server so that the connection is not lost if the server is not active a long time.. I thought that if I set the interactive_timeout and the wait_timeout at a high level the problems would be solved but when I did some testing by setting the values to 30 seconds the connection persisted. Does anyone know why?
    Please help
    Thanks

    "MySql does not support transactions" is correct.
    Basically there are no commit or rollback statements
    available in MySql. This is I am talking about
    version 3.2.3 I believe. I have used it long back.incorrect.
    if you use the default myISAM tables than there is no transaction support. however, if you use INNODB then there is transaction support available in versions of 3 etc. for sure.
    however, you need a driver that knows this and supports this. i believe the newer versions of the mysql driver support them i know the older org.gjt.mm driver does NOT.
    what driver are you using? some borland one? look at the support there.

  • MySQL trying to connect my java program

    I am trying to write a java program that I can connect to a MySQL database on my compter. I have typed out this example that is in a text book I have and I am trying to connect my java program to a MySQL database. The version of MySQL is 4.1 which I have recently downloaded onto my computer and is working fine. The problem I am having is in ther places where it says "WHAT DO I ENTER HERE", basically the 'database.properties' , the 'jdbc.drivers' and the 'jdbc.url' string names. I do not know what I am supposed to enter. If you could give me some help with what I am supposed to enter or an example of a java program that already works with MySQL that would be of great help to me. A working example would be the greatest help to me .
    Thank-you.
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    class TestDB
    public static void main (String args[])
      try
        Connection conn = getConnection();
        Statement stat = conn.createStatement();
        stat.execute("CREATE TABLE Greetings (Name CHAR(20))");
        stat.execute("INSERT INTO Greetings VALUES ('Hello World!')");
        ResultSet result = stat.executeQuery("Select * From Greetings");
        result.next();
        System.out.println(result.getString(1));
        result.close();
        stat.execute("DROP TABLE Greetings");
        stat.close();
        conn.close();
      catch (SQLException ex)
       while (ex != null)
         ex.printStackTrace();
         ex = ex.getNextException();
      catch (IOException ex)
       ex.printStackTrace();   
    public static Connection getConnection() throws SQLException, IOException
       Properties props = new Properties();
       FileInputStream in = new FileInputStream("WHAT DO I ENTER HERE");
       props.load(in);
       in.close();
       String drivers = props.getProperty("WHAT DO I ENTER HERE");
       if(drivers != null)
         System.setProperty("WHAT DO I ENTER HERE", drivers);
       String url = props.getProperty("WHAT DO I ENTER HERE");
       String username = props.getProperty("jdbc.username");
       String password = props.getProperty("jdbc.password");
       return
         DriverManager.getConnection(url, username, password);
    }

    public static Connection getConnection() throws SQLException, IOException {
       Properties props = new Properties();
       // It could be absolute or relative path.
       // If the properties file is in the same dir, use the name as shown below.
       FileInputStream in = new FileInputStream("database.properties");
       props.load(in);
       in.close();
       // It will load the driver String from properties
       String drivers = props.getProperty("jdbc.drivers");
       if(drivers != null)
         System.setProperty("jdbc.drivers", drivers);
         // If drivers are not set in properties, set them now.
       String url = props.getProperty("jdbc.url");
       String username = props.getProperty("jdbc.username");
       String password = props.getProperty("jdbc.password");
       return DriverManager.getConnection(url, username, password);
      }Have a look at the comments I inserted. :)

  • CF8 / MySQL 5 - Cannot connect to remote datasource

    Hi all,
    i'm using CF8 on my web server and i'm trying to connect to a
    remote MySQL datasource. Ive doubled checked my settings and ive
    even got my web developer to check the settings and they are all
    correct. My developer can connect to the database no problem, so i
    know it must be an issue with my CF server.
    this is a complete blocker, we cant continue with the
    development until we fix this.
    this is the error i get when i try to verify the db
    connection:

    ok so if type at the command promt this:
    telnet mysql_xx.xx.xx.xx 3306 i get this:
    Connecting To mysql_xx.xx.xx.xx...Could not open connection
    to the host, on port 3306: Connect failed
    if i type this:
    telnet mysql_xx.xx.xx.xx 3306 telnet mysql_Xname.com 3306
    i get this:
    C:\Documents and
    Settings\Administrator.ALLIED-WEB-01>telnet mysql_xx.xx.xx.xx
    3306 telnet mysql_Xname.com 3306
    telnet [-a][-e escape char][-f log file][-l user][-t
    term][host [port]]
    -a Attempt automatic logon. Same as -l option except uses
    the currently logged on user's name.
    -e Escape character to enter telnet client prompt.
    -f File name for client side logging
    -l Specifies the user name to log in with on the remote
    system.
    Requires that the remote system support the TELNET ENVIRON
    option.
    -t Specifies terminal type.
    Supported term types are vt100, vt52, ansi and vtnt only.
    host Specifies the hostname or IP address of the remote
    computer
    to connect to.
    port Specifies a port number or service name.
    what's this telling us? did i type it right?

Maybe you are looking for

  • How to get emails on iphone and mail on my computer?

    Hi there, I use mail on my Mac to get my emails and since getting my iphone i also use this. the problem is when i have mail on my computer open i only get emails sent to it. when i dont have it open i only get them sent to my iphone. how do i set it

  • I am a fool

    After having phone for nearly 2 years, I decided to use the device lock.  Needless to say 20 min.  later it would not let me open it.  As a definition of insanity states- "doing the same over and over and expecting a different result"  I used all 10

  • What is TYPE GROUP /TYPE-POOL?  When to use that ?

    hello friends Can any one tell me What is TYPE GROUP /TYPE-POOL?  When to use that ? Thanks & Best Regards Nilesh

  • I WANT TO CHANGE MY SECURITY QUESTIONS! HELP!

    I've just been trying to make purchases and I can't do it anymore because Apple has asked me to answer my security questions. I can't remember the answer to one of them AND NOW MY ACCOUNT'S LOCKED! I WANT TO CHANGE MY SECURITY QUESTIONS! I really wan

  • Windows network - can't see "real" network drives

    Hi all- I'm hooked up to a Windows network and until my last (standard) password change, things worked ok. Now, although I can see the network drives, and attempt to connect, I get an error message saying that "The alias "Server20" could not be opene