.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MS-JDBC / Hibernate / JDBC Type 9 (NVARCAHR)

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :Sql Server
We are using MS-JDBC v3.0 against SQL 2008 but getting the following error from java/hibernate: 2010-08-11 19:35:35,193 DEBUG [com.example.test.Test] - No Dialect mapping for JDBC type: -9 org.hibernate.MappingException: No Dialect mapping for JDBC type: -9     at org.hibernate.dialect.TypeNames.get(TypeNames.java:79)     at org.hibernate.dialect.TypeNames.get(TypeNames.java:104)     at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:393)     at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:582) . . . The only work around we find is to provide a custom extension of the sqlDialect. Is this really needed ?

View Complete Post

More Related Resource Links

Has the JDBC 1.2 DataBaseMetaData Results Set type changed from JDBC 1.0/1.2?


Using JDBC Driver 1.2 (specifically Driver version '1.2.2828.100') I make the following call

ResultSet rsTableCols = dbMetadata.getColumns(CATALOG,SCHEMA_PATTERN, tableName, COLUMN_NAME_PATTERN);

after the above I make the following call:


which fails with

com.microsoft.sqlserver.jdbc.SQLServerException: The requested operation is not supported on forward only result sets.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerResultSet.throwNotScrollable(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerResultSet.verifyResultSetIsScrollable(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerResultSet.beforeFirst(Unknown Source)
	at jwc.jdbc_test.main(jdbc_test.java:39)

Note 1: the call does not fail if I use JDBC 1.0/1.2.

Note 2: the call also fails if I connect to SQL Server 2008 with the appropriate drivers.

I have inspected the ResultSet instance and there appear to be difernces in the statement type and appResultSetType.

Does any have any ideas what h

How can I improve the performance of batch inserts with the JDBC driver?

In our testing, batch inserts are more than 4 times faster on Oracle with the Oracle JDBC driver than on SQL Server with either the Microsoft or jTDS JDBC drivers on the same hardware.  The issue appears to be with the JDBC driver, not the database server.  We have run tests with SQL Server 2005/2008 on a number of machines with similar results. The following code shows a simplified example of the code we are executing.  It uses a 2 column table which has an index on the id column.  In the test program we are inserting 100k rows with a batch size of 10k.  Any suggestions on improving the performance with the SQL Server JDBC driver?   private void testBatchInserts(Connection conn, int rows, int batchSize) throws SQLException {     String sql = "INSERT INTO Bench (id, name) VALUES (?, ?)";     conn.setAutoCommit(false);     PreparedStatement stmt = conn.prepareStatement(sql);     int batchCount = 0;     // For each row...     for (int i = 1; i <= rows; i++) {       // Create the record       stmt.setInt(1, i);       stmt.setString(2, "ROW #" + i);       // Add it to the batch       stmt.addBatch(); &nb

How do I install SQL Server 2005 JDBC driver

I'm an new bie to "SQL Server 2005 JDBC Driver". I have downloaded SQL Server 2005 JDBC driver and extracted it to C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\. Is the installation complete now? How can I use this driver from my application? If there is a step-by-step instruction on whether we need to run some scripts in SQL Server or to configure some system variables, it would be great. Thanks in advance for your time in this.Cheeeeerrzzzz! S@kthi http://blogs.msdn.com/sqlsakthi | http://twitter.com/PowerSakthi Mark as Answer if it helps. This posting is provided "AS IS" with no warranties and confers no rights.

Getting JDBC metadata for synonyms

Using the Latest JDBC Driver from SQLExpress I'm attempting to get use the getTable() method to get information about database objects that the user can access/alter.   Works fine for for tables and views, but can't seem to get any information returned for synonyms.Is it possible to get information for synonyms, e.g. column definitions? or am I'm missing some setting in the connection.Any Help would be appreciated!Dave.

NTLM support w/ MS JDBC 3.0

Does the latest driver support NTLMv2 (windows) authentication ? I have several developers using non-windows OSs, the JTDS driver works with a connect sting: jdbc:jtds:sqlserver=\\server;useNTLMv2=true;domain=<domainName> , provided the username is not in a domain context (domain\user), this method via JTDS works on all machines, Unix, Windows, osX. I have NOT been able to get this to work on any non-domain windows machine.

SQL Server JDBC Driver 1.2 Issue

I am using JDBC 1.2 driver to connect to Sql Server 2005 database and i am facing the application crash issues several times and javacores shows that the crash happens during JDBC call. This issue is happening several times in our application, please let me know if an upgraded driver version will fix the problem or to investigate the driver issue further NULL            1XMCURTHDINFO  Current Thread Details NULL           ---------------------- 3XMTHREADINFO      "WebContainer : 8" (TID:0x5946E100, sys_thread_t:0x51D052F0, state:R, native ID:0x000008AC) prio=5 4XESTACKTRACE          at com/microsoft/sqlserver/jdbc/PLPInputStream.getBytes(Bytecode PC:64(Compiled Code)) 4XESTACKTRACE          at com/microsoft/sqlserver/jdbc/DDC.xmlPLPToObject(Bytecode PC:132(Compiled Code)) 4XESTACKTRACE          at com/microsoft/sqlserver/jdbc/ServerDTVImpl.getValue(Bytecode PC:216(Compiled Code)) 4XESTACKTRACE          at com/microsoft/sqlserver/jdbc/DTV.getValue(Bytecode PC:216(Compiled Code)) 4XESTACKTRACE          at com/micro

SQL Server JDBC: java.lang.SecurityException: Invalid signature file digest?

Hi I am following these instructions for using SQL Server JDBC driver and using sqljdbc4.jar file: http://msdn.microsoft.com/en-us/library/ms378526.aspx When registering the driver to instruct JDBC Driver Manager which driver to load: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); It throws and exception: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes What does this mean and how do I resolve it? NOTE: I followed a similar posting, but it did not resolve it: com.microsoft.sqlserver.jdbc.SQLServerException.class throws java.lang.SecurityException: http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/ab35688e-ca33-423e-a9bd-54e30fcb5091/ Thanks Jeff in Seattle

Microsoft SQL Server 2005 JDBC Driver

I'm getting the following exception when attempting to connect to SQL Server 2005 using Microsoft's new JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect The help docs suggest checking connectivity using telnet. So attempting to connect via telnet to generates: Could not open connection to the host, on port 23: Connect failed. So I try to start telnet: net start telnet I get the following error message: The service cannot be started either because it is disabled or because it has no enables devices associated with it. Can anyone help? Thanks

JDBC access to SQL 2008 from Red Hat Linux

Client is Red Hat Linux. Server is Windows 2008 running MS-SQL 2008. I am able to connect to the database using a SQL Server User ID and pasword. I cannot connect to the database using a Windows Domain ID and password. Is the use of a Windows Domain ID and password supported?

JDBC and Integrated security

So, I'm still getting errors when configuring a connection with integrated security: and YES, I copied the sqljdbc_auth.dll into system32 directory (and I put a copy into systemWOW64 also.).<---   error message:ect to Development Server.  Error creating SQL Model Connection connection to Development Server. (Error: This driver is not configured for integrated authentication.)  This driver is not configured for integrated authentication.  Error creating JDBC Connection connection to Development Server. (Error: This driver is not configured for integrated authentication.)  This driver is not configured for integrated authentication.end error message --->I'm no expert here, but the message indicates, to me, that it's the *driver* that doesn't support integrated security. WTF? Was this an oversight? Or is something wrong on my side (Win 7, SQL2005, Eclipse Data Tools, sqlJDBC4, both ver 2.0 and v3[CTP]). I saw messages relating back to version 1.2 that this problem would be fixed.Mark

Microsoft JDBC driver 3.0

Our application used Inet opta driver. Would like to try out the Microsoft driver. If you have used this driver, please provide more info on Microsoft jdbc driver 3.0.

SQL JDBC Connection timed out, please help, I am in urgent

Hi there, i am working on SQL JDBC 2005 version 1.1. I have a liferay portal database located at server 1, wsrp portlets' database located at server 2 (with instance name instance1). The producer (liferay) have to create a connection with server 2 (use connection string) to authenticate the consumer. If the registration properties is valid, then the consumer are able to consume the wsrp portlet. (Note that i use tomcat as web container)But when the producer connect to server 2, tomcat throws error:com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection timed out: connect    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)    at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)    at java.sql.DriverManager.getConnection(DriverManager.java:525)    at java.sql.DriverManager.getConnection(DriverManager.java:193)     at   com.mypackage.utils.DBUtils.getDBConnection(DBUtils.java:45)My connection string pattern is : "jdbcqlserver://{0}:{1};User={2};Password={3};DatabaseName={4}"Which {0}: s

SQL SERVER JDBC: WARNING: Failed to load the sqljdbc_auth.dll

Getting this warning when I run my application.  I have already read the posts that repeat the 'put it in your path mantra' over and over again.  Please, do not redirect me to those posts they are useless.  I am telling you I have this DLL in my java.library.path, and I know this because I can load the DLL with java.lang.System.loadLibrary.  i even tried the directions on the MSDN sight and put the install path directly into my java.library.path.  I still get the warning.  Your driver has a bug, please fix it.

newbie in Java .... java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

Hi All, I am new to java, trying to learn and understand. I downloaded the 2008 R2 SQL server Express, Downloaded the JDBC jar file, unzipped it. and set class_path accordingly in environmental variables. C:\Program Files\Microsoft SQL Server JDBC Driver\sqljdbc_3.0\enu\sqljdbc.jar, C:\Program Files\Microsoft SQL Server JDBC Driver\sqljdbc_3.0\enu\sqljdbc4.jar Also I have added the sqljdbc_auth.dll in the system32 file as most of the content suggested. I tried running a simple program that microsoft has provided . I have not advanced to programs such as eclipse and others, I am using a simple textpad to write and see if it connects the way it is supposed to . I hope you can guide me through the process. My TCP/IP is enabled, dynamic ip is left to blank, I can successfully telnet to 1433 port . Am I doing something wrong or am I missing a step somewhere   import java.*; public class Connect{      private java.sql.Connection  con = null;      private final String url = "jdbc:microsoft:sqlserver://";      private final String serverName= "localhost";      private final String portNumber = "1433";      private final String databaseName= "Banking";      private final String userName = "sa";   &nb

JDBC connection to SQLserver failing with ERROR [JDBCExceptionReporter] The connection is closed.

SQL server version: MS 2005 9.00.3050.00 Std edition Development version is on a stand alone server. Production is on an active/active cluster. Full error message below. There is an explanation and solution as noted below. However we do not see this issue in all our environments. Can anyone tell me why we see this issue in our production environment but not on our development environment, especially as the issue seems to arise following low usage times. Explanation / Solution If you are using the v1.2 driver, and you can positively rule out transient network connectivity issues and multithreaded usage, the next most common cause I am aware of is where a connection pool is being used and the pooling manager (e.g. DBCP or C3PO) does not test pooled connections for validity before handing them out to the app. What happens in this case is connections that sit idle in the pool for a very long time get closed by the TCP/IP stack, routing hardware, etc. Then they're already dead when the pooling manager hands them out. The solution is to configure the pooling manager to validate connections before handing them out, typically using a validation query like "SELECT 1". Error Message INFO | jvm 1 | 2010/09/07 07:52:11 | [09.07 07:52:11.396] LOG ERROR BROKO-EY-TBF-REDUCED-ENV-DP> INFO | jvm 1 | 2010/09/07 07:52:11 | - broko.quark.QueueMonitorThread.getNextCommand(QueueM

Recommend the best JDBC driver and version to connect to SQL server 2005 sp2


SQL version details:Microsoft SQL Server 2005 - 9.00.3050.00 (Intel X86) Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2) on a clustered server.

Are there any issues using:

JDBC driver: Microsoft SQL Server JDBC Driver 3.0.
JBOSS: JBoss 4.2.3 with JDK 6 ?

Issue with Registering to Redistribute SQL JDBC Driver


At the link http://msdn.microsoft.com/en-us/sqlserver/aa937725.aspx -  Register for Microsoft SQL Server JDBC Driver Redistribution Rights.

It appears that you can register to redistribute the SQL jdbc.jar.  Yet, when you click the I Accept -- you get a "broken link" or 404.    I registered with the Site Feedback for the SQL server site.   Anyone done this in the past or know if Microsoft still supports this?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend