1、错误描述
java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.SQLError.createSQLEx...
分类:
数据库 时间:
2015-06-11 13:09:17
阅读次数:
172
在植物日记的app里,使用SQLite3进行数据存放,为了简化代码,使用了FMDB框架进行数据库操作。几个注意点:1.executeQuery和executeUpdate的区分 除了SELECT操作使用executeQuery以外,其他操作都是executeUpdata。2.数据库读写图片 ...
分类:
移动开发 时间:
2015-06-05 19:25:13
阅读次数:
135
statement使用方法Statementstatement=connection.createStatement();
StringqueryString="selectusername,passwordfromuser_tablewhereusername=‘"+
username+"‘andpassword=‘"+password+"‘";
ResultSetresultSet=statement.executeQuery(queryString);statement为非预编译语..
分类:
编程语言 时间:
2015-05-18 13:03:57
阅读次数:
103
通过jdbc链接数据上SqlServer数据库,其中单个执行sql是没有问题的,但执行下列的executeQuery方法 // 对象集 ResultSet resultList = stm.executeQuery(sb.toString()); 提示错误:com.microsoft.sqlserver.jdb...
分类:
数据库 时间:
2015-05-14 22:14:34
阅读次数:
585
Can not issue data manipulation statements with executeQuery()
出错地方:st.executeQuery("insert into student values(“1”,“2”,“3”)") ;
如果你的SQL 语句是 update,insert等更新语句,用statement的execute()
...
分类:
其他好文 时间:
2015-05-01 18:44:53
阅读次数:
179
首先应该按照网上搜到的方法检查一下是否是一个statement对多个ResultSet进行操作。比方说:Statementst=conn.CreateStatement();ResultSetrs1=st.executeQuery();ResultSetrs2=st.executeQuery();则必须先对rs1进行操作,然后再对rs2进行操作,不能交替操作。否则会引起rs已经..
分类:
其他好文 时间:
2015-05-01 01:56:55
阅读次数:
132
query是查询用的,而update是插入和更新,删除修改用的。executeQuery()语句是用于产生单个结果集的语句,如select语句,在什么情况下用,当你的数据库已经保存了数据后,要进行查询了。executeUpdate(),用于执行insert、update或者delete语句,返回值一...
分类:
其他好文 时间:
2015-04-18 17:35:52
阅读次数:
112
ExecuteQuery主要用于DataContext类直接执行SQL语句的查询,在MSDN上有两种执行方法,下面为两种方法的不同调用:1、ExecuteQuery(String,Object[]) 应该是微软的推荐方法,网上几乎都在用的方法NorthwindDataContext ctx = ne...
分类:
其他好文 时间:
2015-04-01 19:33:59
阅读次数:
141
这次进化完成后,JDBC的进化就需要设置一个savepoint了,然后提交一下,提交到我们的脑袋硬盘中。
上一次说到了利用Statement对象来发送sql语句到数据库。然而这样的话,会暴露出两个问题。
那么问题来了!!!
问题1:
在执行executeUpdate(String sql)和executeQuery(String sql)方法时,我们需要拼写sql字符串,就像下面这样:Str...
分类:
数据库 时间:
2015-03-06 23:41:02
阅读次数:
458
String sql2="select count(*) from t_testuser where substr(INSETTIME,1,10)=to_char(sysdate,'yyyy-MM-dd') ";ResultSet rs2=stmt.executeQuery(sql2);while(...
分类:
数据库 时间:
2015-03-05 12:17:05
阅读次数:
165