-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Hibernate and SQL Server 2000
PostPosted: Wed Jul 21, 2004 1:56 pm 
Regular
Regular

Joined: Mon Jan 19, 2004 10:39 pm
Posts: 84
Location: Nottingham, England
Hi,
I am currently running Hibertnate 2.1 on OS X 10.3.4 with postgreSQL 7.4.1 and tomcat 5 as the container with no problems at all.
I have now installed tomcat 5/hibernate 2.1 on windows server 2000. The database being used on this platform is sql server 2000. I would therefore like to configure my hibernate.cfg.xml file to reflect the fact that it needs to connect to sql server. So what do I need to specify in the following 2 lines, taking into consideration that sql server is on another machine?:

I have placed the JSQLConnect jdbc driver in my web-inf/lib directory.

<property name="connection.driver_class"></property>
<property name="connection.url"></property>

Also, are there any decent jdbc drivers for sql server 2000 which don't cost heaven and earth to purchase?

thanks in advance

Andrew


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 2:01 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
maybe google will give you a faster response or a sqlserver forum...

does this help:
Version supported: 2000, but creating a dialect for version 7 should be easy. jTDS: also used with Sybase. Use some driver other than Microsoft's own! If you use the MS JDBC driver, these are the issues you will face: Blobs and Clobs are not supported. Problems with Dates: MSSQL when you search for dates wants to search by seconds and milliseconds. When you convert a SQL date to a Java Timestamp object, and then back again, you seem to lose the milliseconds. The seconds match, but not the milliseconds. So don't use date's as part of a composite key/primary key. Reportedly, the Microsoft JDBC driver is quite slow, you have to add sendStringParametersAsUnicode=false to JDBC URL to increase performance. You must always use selectMethod=cursor. You may get a "Reread" error when reading tables with NVARCHAR or Images. You can solve that issue by proxying the MS JDBC Driver: MSJdbcProxy. Microsoft SQL Server does actually not ship with a JDBC driver. Various third party drivers are available, some (but not all) of which do work. If you are using triggers, Hibernate will get confused when the first result returned by a statement is "0" (in jTDS, use the parameter lastUpdateCount=true in the driver). The following drivers are known to work: JSQL http://www.j-netdirect.com, JTurbo http://www.newatlanta.com/products/jturbo, Weblogic jDriver http://www.bea.com/products/weblogic/drivers.shtml - it is quite likely that you will be able to use either of the following two drivers (which actually appear to be the same driver) successfully: Microsoft SQL Server 2000 Driver for JDBC SP1 and DataDirect Connect for JDBC (http://ddtek.com). There are some weird date-handling issues with these drivers, so they are not officially supported. Don't bother with the DataDirect SequeLink driver; it has very serious problems. We have had great luck (not a single issue) with the inet drivers (http://www.inetsoftware.de/) but they are relatively expensive.

?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: anthony....
PostPosted: Wed Jul 21, 2004 2:16 pm 
Regular
Regular

Joined: Mon Jan 19, 2004 10:39 pm
Posts: 84
Location: Nottingham, England
thanks for your promot reply, but how do I coinfigure the following 2 lines of my hibernate.cfg.xml file?

<property name="connection.driver_class"></property>
<property name="connection.url"></property>

I am interested in what the syntax for sql server should be in this instance...


regards

Andrew


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 9:42 pm 
Beginner
Beginner

Joined: Thu Jul 22, 2004 4:32 am
Posts: 31
You can config like this:

weblogic:
<property name="connection.driver_class">weblogic.jdbc.mssqlserver4.Driver</property>
<property name="connection.url">jdbc:weblogic:mssqlserver4:YourDatabaseName@DatabaseServerAddress:1433</property>
<property name="connection.username">DatabaseUserName</property>
<property name="connection.password">DatabaseUserPassworcd</property>

JSQLConnect:
<property name="connection.driver_class">com.jnetdirect.jsql.JSQLDriver</property>
<property name="connection.url">jdbc:JSQLConnect://DatabaseServerAddress/database=YourDatabaseName/user=DatabaseUserName/password=DatabaseUserPassworcd</property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 9:46 pm 
Beginner
Beginner

Joined: Thu Jul 22, 2004 4:32 am
Posts: 31
You also can use JNDI to connect to database:

<property name="connection.datasource">YourDataSourceName</property>
<property name="connection.provider_class">net.sf.hibernate.connection.DatasourceConnectionProvider</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="jndi.url">t3://YourDatasourceServerAddress:7001</property>
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.