Hello I am trying to get a SELECT stament to work i Java. The staement has a parameter, but Eclipse gives me the following error message:
You have an error in your SQL syntax, check the manual that corresponds to your MySQL version......
Is it possible to show me how to use ' and " in the statement
String todo = ("SELECT * FROM Emp WHERE Name = '"+text1+"')")
More details:
public ResultSet connectTwo(String text1) {
Connection conn = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "Mg78QnuE");
String todo = ("SELECT * FROM Emp WHERE Name = '"+text1+"')") ;
Thank You!