`
houzhaowei
  • 浏览: 497967 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

java 与 SqlServer 交互遇到的问题及解决方案<updating>

阅读更多

----------【HIbernate】java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z

解决方案:

问谷老师得知是microsoft提供的数据库驱动存在bug。需要换一种驱动连接,使用jtds(下载地址:http://sourceforge.net/projects/jtds/files/)下载jtds1.2.5版,解压得到jtds-1.2.5.jar,引用到eclipse中项目目录下(去除原驱动引用),更改hibernate配置文件:

原驱动连接配置:

 <property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
        <property name="connection.url">jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=hibernate</property>
更改jtds连接:   
        <property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
        <property name="connection.url">jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=hibernate</property>

问题得到解决。补充:java代码调原驱动连接数据库是没有问题的,搭配hibernate会有此问题。

分享到:
评论

相关推荐

    M5310-A模组AT指令手册2.0

    &lt;CR&gt;&lt;LF&gt;FIRMWARE UPDATING&lt;CR&gt;&lt;LF&gt; Indicates UE is updating. &lt;CR&gt;&lt;LF&gt;FIRMWARE UPDATE SUCCESS&lt;CR&gt;&lt;LF&gt; Indicates update success, but not report update state to firmware package server yet.

    Visual C++ 编程资源大全(英文源码 ATL)

    update_wtl.zip&lt;br&gt;Notes on updating your WTL installation(2KB)&lt;END&gt;&lt;br&gt;27,sidebarmenu.zip&lt;br&gt;An article about changing the look of WTL icon menu(85KB)&lt;END&gt;&lt;br&gt;28,customdraw.zip&lt;br&gt;How to use WTL to ...

    Visual C++ 编程资源大全(英文源码 数据库)

    09.zip&lt;br&gt;Print Mailing Labels&lt;br&gt;打印邮件标签(8KB)&lt;END&gt;&lt;br&gt;10,10.zip&lt;br&gt;RFX_Date alternative&lt;br&gt;关于RFX_Date(4KB)&lt;END&gt;&lt;br&gt;11,11.zip&lt;br&gt;RFX_Date using COleDateTime&lt;br&gt;使用COleDateTime(6KB)&lt;END&gt;&lt;br&gt;12,...

    中移物联 M5310 AT指令 英文版

    &lt;CR&gt;&lt;LF&gt;FIRMWARE UPDATING&lt;CR&gt;&lt;LF&gt; Indicates UE is updating. &lt;CR&gt;&lt;LF&gt;FIRMWARE UPDATE SUCCESS&lt;CR&gt;&lt;LF&gt; Indicates update success, but not report update state to firmware package server yet. &lt;CR&gt;&lt;LF&gt;...

    Using DIB Sections in VB

    &lt;br&gt;&lt;br&gt; m_hDC = CreateCompatibleDC(0) &lt;br&gt; If (m_hDC &lt;&gt; 0) Then &lt;br&gt; If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then &lt;br&gt; m_hBmpOld = SelectObject(m_hDC, m_hDIb) &lt;br&gt; Create = True &lt;br&gt; Else &lt;br...

    outpost firewall4 win2003 sp2 补丁(x86)

    The problem is related to core components functioning peculiarities after updating Windows 2003 to SP2.&lt;br&gt;&lt;br&gt;The issue is fixed in the new Outpost driver.&lt;br&gt;&lt;br&gt;Please replace the firewall driver ...

    联想旭日420AXP系统声卡驱动

    ;Windows 2000/XP WDM Modem Setup File ;... 2004-2006 ;Manufacturer: Motorola Inc [Version] Signature = "$Windows NT$" Class = Modem ClassGUID = {4D36E96D-E325-11CE-BFC1-08002BE10318} ...

    旭日420AXP系统调制解调器驱动

    ;Windows 2000/XP WDM Modem Setup File ;... 2004-2006 ;Manufacturer: Motorola Inc [Version] Signature = "$Windows NT$" Class = Modem ClassGUID = {4D36E96D-E325-11CE-BFC1-08002BE10318} ...

    Microsoft ADO.NET Step by Step

    Editing and Updating Data &lt;br/&gt; &lt;br/&gt;Chapter 10 - ADO.NET Data-Binding in Windows Forms &lt;br/&gt; &lt;br/&gt;Chapter 11 - Using ADO.NET in Windows Forms &lt;br/&gt; &lt;br/&gt;Chapter 12 - Data-Binding in Web Forms &lt;br/&gt; ...

    Software Testing and Continuous Quality Improvement

    Software Testing and Continuous Quality Improvement&lt;br&gt;&lt;br&gt;SECTION I SOFTWARE QUALITY IN PERSPECTIVE . . . . . . . . . . . . . . . 1&lt;br&gt;1 Quality Assurance Framework. . . . . . . . . . . . . . . . . ....

    SQL Server Data Access Components 2.45.22 for d6

    [SQL Server] &lt;-&gt; [DBLibrary] &lt;-&gt; [SQL Links] &lt;-&gt; [BDE] &lt;-&gt; [Client application]SDAC works directly through OLE DB, which is a native SQL Serverinterface. Applications with SDAC components access ...

    springMVC整合FastJson实现RestFul风格API

    &lt;groupId&gt;org.springframework&lt;/groupId&gt; &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt; &lt;version&gt;5.x.y.RELEASE&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.alibaba&lt;/groupId&gt; &lt;artifactId&gt;fastjson&lt;/...

    Delphi7.1 Update

    Cannot access field &lt;fieldname&gt; as type variant.&quot; * TClientDataSet doesn‘t save data to file when FileName is set and there is no existing file on disk (Quality Central 2307). * Using the Delphi...

    java.util.ConcurrentModificationException 异常问题详解1

    Java.util.ConcurrentModificationException 异常问题详解 ConcurrentModificationException 异常是 Java 中一个常见的异常,它发生在 Iterator 遍历集合时,集合同时被修改引起的异常。在 Java 中,集合类如 ...

    SQL Server T-SQL Recipes, 4th Edition

    本书不仅提供了丰富的示例代码,还深入探讨了SQL Server中的常见问题及其解决方案。 #### 核心章节概览 **1. Getting Started with SELECT** - **基础查询**: 介绍如何使用`SELECT`语句进行基本的数据检索。 - **...

    【11.x推荐版本】AP无线接入点RGOS11.1(5)B9P11软件版本【适用于AP520】

    |&lt;3&gt; Delete File | |&lt;0&gt; Exit To Main Menu | ============================================================================ Enter your choice(0-3): 3 【bootware模式下按3删除已经上传的文件】 Deleting...

    mitV:GitHub的Web提交查看器(com)mitV(iewer)!

    $ go build mitV.go#跑步 $ mitV.exe &lt;GithubOauthToken&gt; &lt;repo&gt; &lt;host&gt;&gt; &lt;update&gt;eg.$ mitV.exe &lt;token&gt; Matt-Allen44/mitV 127.0.0.1:8080 10 This would launch a server watching commits to this repo, and ...

    PHP、MySQL教程:PHP访问MySQL篇

    echo ("&lt;P&gt;Unable to connect to the databases server at this time.&lt;/P&gt;"); exit(); } ``` 这样,如果连接失败,则会显示错误消息并终止脚本的执行。 ### 使用 @ 符号抑制错误 有时为了防止连接失败时出现错误...

    SQLServer 数据库变成单个用户后无法访问问题的解决方法

    此外,文章中还提到了其他一些与数据库管理和故障排除相关的文章链接,比如MySQL的相关问题,如"The server quit without updating PID file",以及SQL Server的其他常见问题,如阻止保存要求重新创建表的更改、远程...

    Linq在gridview上实现三层结构(增,删,改,查)

    在数据访问层(DAL),我们可以使用LINQ to SQL或Entity Framework来与数据库交互。这里我们以LINQ to SQL为例,创建一个`DataContext`类,该类将包含对数据库的连接以及`Employee`表的映射: ```csharp partial ...

Global site tag (gtag.js) - Google Analytics