RATE THIS ANSWER
0
Click to Vote:
0
0
"
i used my local server that is tomcat. But my website is in linux server.
"
You are talking about two different things here. Tomcat is a jsp/servlet container, while Linux is an operating system. Tomcat can run on many different operating systems, including Linux.
As for the database connection: are you using jdbc ?
If so, the code to connect to the database should look like this:
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
// here we are connecting to localhost, port 3306. Change it to your db server address:port
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/databaseName",
"root", "secret");
//or con = DriverManager.getConnection("jdbc:mysql://localhost:3306/databaseName?user=
root&password=secret";
}
catch(Exception e){
System.out.println(e.getMessage());
}
Last Answered:
Feb 25 2009 7:40 PM GMT by Carlosdl 
29820 pts.