标准表达式中数据类型不匹配。 jsp
<%try{Stringemployee_name=request.getParameter("employee_name")==null?"张三":request.ge...
<%
try{ String employee_name = request.getParameter("employee_name")==null?"张三":request.getParameter("employee_name");
//long ENAME = Long.parseLong(employee_name);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:db_ilike");
Statement dbc = con.createStatement();
String sqlStmt= "SELECT employee_bm, employee_name, employee_indentify, employee_time, employee_zhiwu, employee_remark FROM employee_tb where employee_name=" +employee_name;
ResultSet rs= dbc.executeQuery(sqlStmt);
rs.next();
%>
不知道问题出在哪里。。。求大神解答。。。 展开
try{ String employee_name = request.getParameter("employee_name")==null?"张三":request.getParameter("employee_name");
//long ENAME = Long.parseLong(employee_name);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:db_ilike");
Statement dbc = con.createStatement();
String sqlStmt= "SELECT employee_bm, employee_name, employee_indentify, employee_time, employee_zhiwu, employee_remark FROM employee_tb where employee_name=" +employee_name;
ResultSet rs= dbc.executeQuery(sqlStmt);
rs.next();
%>
不知道问题出在哪里。。。求大神解答。。。 展开
1个回答
展开全部
String sqlStmt= "SELECT employee_bm, employee_name, employee_indentify, employee_time, employee_zhiwu, employee_remark FROM employee_tb where employee_name='" +employee_name"'";
改成这样试下
改成这样试下
追问
--还是不行。。。标准表达式中数据类型不匹配依然这样提示。我想是不是我定义的数组类型同SQL里面的不符合,SQL是文本类型应该怎么定义呢
追答
文本类型的是用String,整型的就不用加引号,文本型的最好操作了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询