Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to a GoDaddy database with JSP

Status
Not open for further replies.

troyarch

MIS
Joined
Mar 12, 2003
Messages
29
Location
US
Is there some sample JSP code that can show me how to test a database connection to a MySQL database on a GoDaddy server. I know the GoDaddy hostname, database name, username, and password. GoDaddy Support only provides PHP sample code. Thanks.
 
Code:
String url = "jdbc:mysql://localhost:3306/test";
String user = "test";
String password = "test";

Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(url, user, password);

Replace localhost with your server name or IP, and the user/password.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Oh, and replace "test" in the url with your mysql database name.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top