aspose file tools*
The moose likes Applets and the fly likes how to express Database  url properly?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "how to express Database  url properly??" Watch "how to express Database  url properly??" New topic
Author

how to express Database url properly??

Caven Wang
Ranch Hand

Joined: Jul 07, 2001
Posts: 31
I am using jdbc to connect database in an applet(on the same machine, ip is 202.96.193.122):
method1 works: sqlConn=java.sql.DriverManager.getConnection ("jdbc:mysql://localhost:3306/resource?user=caven;password='winner'");
method2 goes wrong:
sqlConn=java.sql.DriverManager.getConnection ("jdbc:mysql://202.96.193.122:3306//resource?user=caven&password='winner'");

why?


@_@ Life is so nice!
Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 435
Hi,
You will use the address of localhost and not your ip address
your localhost address is 127.0.0.1
I hope you get it right this time


Help gets you when you need it!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to express Database url properly??
 
Similar Threads
Help...JSP, MySql, and JDBC
JDBC Connectivity problem
JDBC BEAN AND SOURCE
MySQL & JDBC
how to connect MySql