Java 找不到错误mysql
这是我正在使用的代码,但问题是我得到了一个错误,上面说: 错误:java.sql.SQLException:找不到列“” 但我可以看到它确实存在于表格中Java 找不到错误mysql,java,mysql,database,exception,xampp,Java,Mysql,Database,Exception,Xampp,这是我正在使用的代码,但问题是我得到了一个错误,上面说: 错误:java.sql.SQLException:找不到列“” 但我可以看到它确实存在于表格中 关于如何解决这个问题有什么想法吗?试着这样写你的查询: PreparedStatement codePull = (PreparedStatement) con.prepareStatement("SELECT tanCode FROM `tancodes` WHERE (tanIndex= "+Tindex+")"); Res
关于如何解决这个问题有什么想法吗?试着这样写你的查询:
PreparedStatement codePull = (PreparedStatement) con.prepareStatement("SELECT tanCode FROM `tancodes` WHERE (tanIndex= "+Tindex+")");
ResultSet DbTcode = codePull.executeQuery();
String answer = DbTcode.getString("");
return answer;
在这里写下列的名称,如:
"SELECT tanCode FROM tancodes WHERE tanIndex= '"+Tindex+"'"
因为它是:“它不是列的名称
DbTcode.getString("tanCode");// for example