Help for a newbee please!

From: Chris Hatton (chrishatton_at_blueyonder.co.uk)
Date: 12/15/04


Date: Wed, 15 Dec 2004 14:10:46 +0000

I'm having problems trying to connect to a remote mySQL db. I have have
got this working on localhost but can get it to work for my website db.

Can anyone point out problems with the code or general problems I shoudl
be looking out for?

        protected Connection getConnection () throws Exception {

             String url = "";
             String userName = "";
             String password = "";
            try {
                    url = "jdbc:mysql://www.tattooplace.co.uk/tattoop_chatusers";
                    userName = "*******";
                    password = "*******";
                       Connection con = DriverManager.getConnection(url, userName,
password);
                System.out.println("Connection established to " + url + "...");
                
                return con;
             } catch ( java.sql.SQLException e ) {
                System.out.println("Connection couldn't be established to " + url);
                throw ( e );
             }
        }