-
connection errors
This is my first attempt to connect to an existing MSQL DB. This is the code and errors. My main question is how can I put this file on the server and execute it or execute this program from eclipse (what is the proper syntax for url?'). I assume that is causing these errors.
[code]import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
Class.forname("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://http;//www.sliditerod.com/", "whitebu4_sliditerod ", "whitebu4_admins" ,"*****"));
PreparedStatememt statement = con.preparedStatement("select * from xyz");
ResultSet result = statement.executeQuery();
while (result.next());
System.out.println(result.getString(1));
}
}
ERRORS PreparedStatememt cannot be resolved to a type
The method preparedStatement(String) is undefined for the type Connection
-
Re: connection errors
You misspelled "PreparedStatement" (you used an 'm' instead of an 'n')