The left-hand side of an assignment must be a variable 这个错误,编译不通过,是什么错误? 40
下面是源代码:publicstaticvoidmain(String[]args){ClassPathXmlApplicationContextcpx=newClassP...
下面是源代码:
public static void main(String[] args) {
ClassPathXmlApplicationContext cpx = new ClassPathXmlApplicationContext("applicationContext.xml");
DataSource dataSource = (DataSource) cpx.getBean("dataSource");
JdbcTemplate jt = new JdbcTemplate(dataSource);
//查询处理语句
String pre_sql = "select * from person where name = ? and age = ?";
//执行带有参数的查询语句
Object[] values = ("李四",21);
List result = jt.queryForList(pre_sql,values);
这个里面倒数第二行总是报错,报的是:The left-hand side of an assignment must be a variable 这个错误,编译不通过,是什么错误?求解,谢谢! 展开
public static void main(String[] args) {
ClassPathXmlApplicationContext cpx = new ClassPathXmlApplicationContext("applicationContext.xml");
DataSource dataSource = (DataSource) cpx.getBean("dataSource");
JdbcTemplate jt = new JdbcTemplate(dataSource);
//查询处理语句
String pre_sql = "select * from person where name = ? and age = ?";
//执行带有参数的查询语句
Object[] values = ("李四",21);
List result = jt.queryForList(pre_sql,values);
这个里面倒数第二行总是报错,报的是:The left-hand side of an assignment must be a variable 这个错误,编译不通过,是什么错误?求解,谢谢! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询