NHibernate连接oracle报错

NHibernate.Exceptions.GenericADOException:“could not execute query
[ select sys_user0_.USERID as USERID1_0_, sys_user0_.LOGINNAME as LOGINN2_0_, sys_user0_.LOGINPASSWORD as LOGINP3_0_, sys_user0_.DEPTID as DEPTID4_0_, sys_user0_.REALNAME as REALNA5_0_, sys_user0_.TILTLE as TILTLE6_0_, sys_user0_.SEX as SEX7_0_, sys_user0_.PHONE as PHONE8_0_, sys_user0_.FAX as FAX9_0_, sys_user0_.PROVID as PROVI10_0_, sys_user0_.CITYID as CITYI11_0_, sys_user0_.ADDRESS as ADDRE12_0_, sys_user0_.EMAIL as EMAIL13_0_, sys_user0_.QQ as QQ14_0_, sys_user0_.NICKNAME as NICKN15_0_, sys_user0_.CREATEUSERID as CREAT16_0_, sys_user0_.CREATEDATE as CREAT17_0_, sys_user0_.MODIFYUSERID as MODIF18_0_, sys_user0_.STATUS as STATU19_0_ from Sys_User sys_user0_ where sys_user0_.LOGINNAME=? and sys_user0_.LOGINPASSWORD=? ]
Name:ln - Value:admin Name:lp - Value:8C36A9ED82896DDA
[SQL: select sys_user0_.USERID as USERID1_0_, sys_user0_.LOGINNAME as LOGINN2_0_, sys_user0_.LOGINPASSWORD as LOGINP3_0_, sys_user0_.DEPTID as DEPTID4_0_, sys_user0_.REALNAME as REALNA5_0_, sys_user0_.TILTLE as TILTLE6_0_, sys_user0_.SEX as SEX7_0_, sys_user0_.PHONE as PHONE8_0_, sys_user0_.FAX as FAX9_0_, sys_user0_.PROVID as PROVI10_0_, sys_user0_.CITYID as CITYI11_0_, sys_user0_.ADDRESS as ADDRE12_0_, sys_user0_.EMAIL as EMAIL13_0_, sys_user0_.QQ as QQ14_0_, sys_user0_.NICKNAME as NICKN15_0_, sys_user0_.CREATEUSERID as CREAT16_0_, sys_user0_.CREATEDATE as CREAT17_0_, sys_user0_.MODIFYUSERID as MODIF18_0_, sys_user0_.STATUS as STATU19_0_ from Sys_User sys_user0_ where sys_user0_.LOGINNAME=? and sys_user0_.LOGINPASSWORD=?]”

内部异常:

Exception: OCIEnvCreate 失败,返回代码为 -1,但错误消息文本不可用。

 

分析:

这是没连接上oracle数据库,具体的原因就是,缺少oracle提供的开发驱动,到oracle官网找到你的数据库版本相对应的客户端安装包,安装之后就可以了,我使用的是oracle 11g的数据库,我安装的是ODTwithODAC112012.zip

posted @ 2017-05-08 22:19  韩梦芫  阅读(604)  评论(0编辑  收藏  举报