Hallo Forum.
Folgender Code wirft eine Exception:
import java.sql.*; // Import der DB Klassen
import java.util.*;
public class main_jdbc
{
public static void main(String[] args)
throws Exception
{
try
{
Class.forName( "com.mysql.jdbc.Driver" );
Properties p = new Properties();
Connection c = DriverManager.getConnection("jdbc:mysql://localhost/test", "user", "pass");
Statement s = c.createStatement();
ResultSet r = s.executeQuery("SELECT * FROM tel;");
while(r.next())
{
System.out.println(r.getString("name")+" "+r.getString("nr"));
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Die Exception lautet:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '????????????????' at line 1
Ich werde daraus nicht schlau. Freue mich über jeden Hinweis!