File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Spring in Action this week in the Spring 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: 436
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??