[Class.forName("com.mysql.jdbc.Driver");
   Connection con = DriverManager
.getConnection("jdbc:mysql://localhost/sqler?"
+ "user=root&password=198367");
   Statement stmt = con.createStatement(); 
   
   String s="select 姓名,性别 ,身份证号,出发时间年月日,出发时间时分秒,lvingbiao.出发地点 ,lvxingbiao.到达地点,航班号,机票价格"
               +"from"+"planeuser,lvxingbiao"
               +"where planeuser.出发时间=lvxingbiao.出发时间年月日and planeuser.出发地点=xingbiao.出发地点 and planeuser.到达地点=lvxingbiao.到达地点" ;   
                                          
  ResultSet rs=stmttt.executeQuery(s);   
总是报错: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 '.??·??±??=lvxingbiao.??·??±???ê????and planeuser.??·?????=xingbiao.??·????? and ' at line 1

解决方案 »

  1.   

    出发时间年月日and ,and 前面要有空格?、
      

  2.   

    还有“from”也在前后加空格试试。“  from  ”。自己debug一下,把拼好的sql放在mysql里面运行一下,就知道哪里错了。
      

  3.   

    这个和空格没关系吧
    链接查询语句可能有问题,或者把你的数据库的字符集设成UTF-8可能会解决中文无法识别的问题
      

  4.   

    where planeuser.出发时间=lvxingbiao.出发时间年月日and planeuser.出发地点 and前面空格