开发者

PreparedStatement not executing!

开发者 https://www.devze.com 2023-02-11 10:39 出处:网络
So odd! :P connection = appDatabase_.getDatabase().getConnection(); PreparedStatement updateStmt = connection.prepareStatement

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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消