NHibernate连接oracle报错

本文介绍了一种NHibernate在尝试执行查询时遇到的GenericADOException,并深入分析了该问题的根本原因在于未能成功连接到Oracle数据库。解决方案是安装对应版本的Oracle客户端驱动,确保应用程序能够正常访问数据库。
摘要由CSDN通过智能技术生成

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

转载于:https://www.cnblogs.com/siyunianhua/p/6828192.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值