Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
来源:百度知道 编辑:UC知道 时间:2024/06/17 22:47:48
我在查询数据库的时候为什么抛出这个异常Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException.我只是执行了查询.executeUpdate.没有getXXX.是不是这样就抛出了异常.但是我用getXXX的时候说没有找到项.但是那个项的确在数据库里存在.但我在插入的时候能成功./还有是不是每次执行操作数据库的时候都要关闭操作,但不关闭连接.?
Exception in thread "AWT-EventQueue-0"应该是由于java.lang.NullPointerException异常所造成的。executeUpdate是更新数据库调用的,你插入数据就是有更新数据库操作了所以有返回值的,就不会抛异常。
当你进行的是查询操作,当然返回值为null,所以会抛异常,查询的时候应该用execute方法。
执行数据库完数据库操作完成后,要关闭连接。
Exception EOleSysError in module
英语作文,主题:in th park
Realistic novel in the 18th century
on June 5th和in June
Christmas in the 13th Month
nothing in thé world 是什么意思?
Report ranks China 6th in overall strength 怎么翻译?
谁能告诉我feminism in 17th century 在英国
The film was released on 11th July in China
Fashions in America before the 19th century_____those of Egland.