ibatisnet连接mysql的问题

franticwind 2010-01-20 11:26:32
我用的ibatisnet版本分别是(dataaccess1.9.2,datamapper1.6.2),连接mysql时报错:Unable to open connection to "MySQL, ByteFx provider V0.7.6.15073".

未处理 IBatisNet.DataMapper.Exceptions.DataMapperException
Message="Unable to open connection to \"MySQL, ByteFx provider V0.7.6.15073\"."
Source="IBatisNet.DataMapper"
StackTrace:
在 IBatisNet.DataMapper.SqlMapSession.OpenConnection(String connectionString)
在 IBatisNet.DataMapper.SqlMapSession.OpenConnection()
在 IBatisNet.DataMapper.SqlMapper.OpenConnection()
在 MicroManager.Ibatis.Dao.UserDaoImpl.InsertUser(User user) 位置 D:\project_cs\MicroManager\MicroManager\src\Ibatis\Dao\UserDaoImpl.cs:行号 26
在 MicroManager.Program.Main() 位置 D:\project_cs\MicroManager\MicroManager\src\Program.cs:行号 30
在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()

请问这是什么问题啊?????

我的配置如下:
SqlMap.config

<?xml version="1.0" encoding="utf-8"?>
<sqlMapConfig xmlns="http://ibatis.apache.org/dataMapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<settings>
<setting useStatementNamespaces="false"/>
</settings>

<providers resource="providers.config"/>

<database>
<provider name="ByteFx" />
<dataSource name="micro_manager"
connectionString="Host=localhost;Database=micro_manager;
Password=123456;Username=root" />
</database>

<sqlMaps>
<sqlMap resource="User.xml"/>
</sqlMaps>

</sqlMapConfig>


模板:user.xml
<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="User" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<alias>
<typeAlias alias="User" type="MicroManager.Ibatis.Domain.User, MicroManager" />
</alias>

<!-- =============================================
MAPPED STATEMENTS
=============================================
-->
<resultMaps>
<resultMap id="SelectAllResult" class="User">
<result property="UserId" column="user_id" />
<result property="UserName" column="user_name" />
<result property="UserPassword" column="user_password" />
<result property="UserRole" column="user_role" />
<result property="UserDate" column="user_date" />
</resultMap>
</resultMaps>

<statements>

<insert id="InsertUser" parameterClass="User">
Insert Into user
(user_id, user_name, user_password, user_role, user_date)
Values
(#UserId#, #UserName#, #UserPassword#, #UserRole#, #UserDate#)
</insert>

<select id ="SelcetAllUser">
Select * from user
</select>

</statements>

</sqlMap>




...全文
286 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuhuan851002 2010-06-26
  • 打赏
  • 举报
回复
怎么解决的啊,我也碰到这个问题,还没解决呢。
franticwind 2010-01-25
  • 打赏
  • 举报
回复
已经解决!结贴。
ILOVE_ASPNET 2010-01-21
  • 打赏
  • 举报
回复
up
平生我自如 2010-01-21
  • 打赏
  • 举报
回复
最近没做asp

帮顶

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧