Results 1 to 1 of 1
Thread: mySQL HELP!!!
- 04-19-2008, 10:39 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 5
- Rep Power
- 0
mySQL HELP!!!
I cannot connect to my database that is on my server!
this is what I have:
After it compiles, I get the following error mesage "Communications link failure LAst packet sen to the server was 0 ms ago."Java Code:String serverName = "xx.xxx.xxx.xx"; //got from website host String mydatabase = "myDbs"; String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url String username = "xx66xx"; String password = "pwd"; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection(url, username, password); } catch (Exception e) { JOptionPane.showMessageDialog(null,e.getMessage(), "ERROR", JOptionPane.PLAIN_MESSAGE); }
Any ideas what is wrong?!?!?
Thanks
Similar Threads
-
Connectiong to MySQL DB
By Java Tip in forum Java TipReplies: 0Last Post: 12-05-2007, 02:22 PM -
help ... JDBC or PHP/MySQL
By bluebarca in forum Advanced JavaReplies: 1Last Post: 11-16-2007, 10:05 AM -
Mysql Help
By Sumendra Maharjan in forum JDBCReplies: 1Last Post: 08-08-2007, 01:19 AM -
servlet using MySql
By Peter in forum Java ServletReplies: 2Last Post: 07-04-2007, 01:48 PM -
JSP and MySQL
By Ed in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 07-04-2007, 05:08 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks