准备好的语句没有执行!
太奇怪了! :P
connection = appDatabase_.getDatabase().getConnection();
PreparedStatement updateStmt = connection.prepareStatement
("UPDATE " + getTableName() + " SET " + column
+ " = ? WHERE " + ID + " = ?");
得到了这段代码。之后是一些硬编码的“set bytes”和“set int”语句。
然后是一个execute()。很简单吧?
有时,准备好的语句无法执行,并且应用程序的行为非常奇怪(很难解释如何进行)。为什么以及何时会发生这种情况?也许如果连接关闭了?
不知道自动取款机怎么想。
谢谢!
So odd! :P
connection = appDatabase_.getDatabase().getConnection();
PreparedStatement updateStmt = connection.prepareStatement
("UPDATE " + getTableName() + " SET " + column
+ " = ? WHERE " + ID + " = ?");
Got this chunk of code. After this comes some hard coded "set bytes" and "set int" statements.
And then an execute(). Pretty simple right?
Occasionally the prepared statement just fails to execute and the app acts very oddly (hard to explain how). Why and when would this happen? Maybe if the connection is closed?
Not sure what to think atm.
Thanks SO!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,既然你没有向我们展示你的 try/catch 并且我知道 java.sql 类充满了声明的检查异常,我的猜测是你正在某个地方吃异常。
Well, since you didn't show us your try/catch and I know java.sql classes are full of declared checked exceptions, my guess would be you're eating exceptions somewhere.