码迷,mamicode.com
首页 >  
搜索关键字:sqlexception    ( 976个结果)
Java判断数据库结果集ResultSet 中是否存在指定列名
if 条件内,如果 rs.findColumn(columnName) > 0 ,ResultSet结果集中的列索引从1开始,不同于数组和list的从0开始,所以如果找到某列,那么它的索引值必然大于0;如果没有找到呢,那么就会有SQLException 异常抛出来,我们这里将这个SQLException 异常利用起来,如果进入异常块,则说明没有找到该列,那么直接返回false就可以了。 这样在mapRow 中,如果多个属性的时候,每次可以判断下,该ResultSet 中是否查询出来该列,查询出来了就做映射,...
分类:数据库   时间:2015-03-29 23:48:08    阅读次数:579
mysql grant
遇到了SQLException:accessdeniedfor@‘localhost‘(usingpassword:no)解决办法grantallprivilegeson*.*tojoe@localhostidentifiedby‘123‘;flushprivileges;拿joe123登陆附:mysql>grant权限1,权限2,…权限non数据库名称.表名称to用户名@用户地址identifiedby‘连接口令’;权..
分类:数据库   时间:2015-03-28 06:30:27    阅读次数:133
oracle密码过期 ORA-28001: the password has expired
oracle11g默认密码过期时间为180天,密码过期后,访问数据库会出现如下异常:java.sql.SQLException:ORA-28001:thepasswordhasexpired查询密码过期设定:select*fromdba_profileswhereprofile=‘DEFAULT‘andresource_name=‘PASSWORD_LIFE_TIME‘;修改密码过期为:unlimitedalterpr..
分类:数据库   时间:2015-03-18 06:37:02    阅读次数:172
JDBC学习笔记(6):PreparedStatement解决SQL注入问题
SQL注入问题:要求根据传入的name查询指定用户信息: 1 package com.xxyh.jdbc; 2 import java.sql.Connection; 3 import java.sql.ResultSet; 4 import java.sql.SQLException; 5 imp...
分类:数据库   时间:2015-03-17 19:54:09    阅读次数:170
JDBC学习笔记(4):单例工具包
为了方便操作将连接数据库、关闭资源操作使用工具包完成: 1 package com.xxyh.jdbc; 2 import java.sql.Connection; 3 import java.sql.DriverManager; 4 import java.sql.SQLException; 5 ...
分类:数据库   时间:2015-03-16 14:15:21    阅读次数:130
JDBC学习笔记(5):数据库的基本操作CRUD
1.查询public static void read() throws SQLException { Connection conn = null; Statement stmt = null; ResultSet rs = null; ...
分类:数据库   时间:2015-03-16 14:14:03    阅读次数:165
Connections could not be acquired from the underl
重装mysql后:启动eclipse时发生这个异常。 java.sql.SQLException: Connections could not be acquired from the underlying database! 百度了下, 帐号密码错误 ?我这里查帐号密码没有错误 因为mysql重装了,该...
分类:其他好文   时间:2015-03-14 17:06:00    阅读次数:149
hive jdbc connection refused
hive jdbc 连接时抛异常:Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://192.168.206.128:10000/d...
分类:数据库   时间:2015-03-14 06:07:42    阅读次数:1007
java实现的JDBCTemplate工具
1.DButilimport java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;impo...
分类:数据库   时间:2015-03-13 18:21:22    阅读次数:190
解决Oracle ORA-12505, TNS:listener does not currently know of SID given in connect
完整的错误信息如下:java.sql.SQLException: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given...
分类:数据库   时间:2015-03-13 01:38:35    阅读次数:379
共976条   上一页 1 ... 76 77 78 79 80 ... 98 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!