-->
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: sql server jdbc driver property name?
PostPosted: Fri Aug 18, 2006 7:00 am 
Newbie

Joined: Fri Aug 18, 2006 6:47 am
Posts: 11
I am trying to get the simple application running from the command line, I am using sql server 2005, i have downloaded the JDBC driver for sql server 2005 from the windows website, and placed hte jar file sqljdbc.jar in the hibernate/lib directory and in the tutorial/lib directory. Everything builds ok and I then run the command

ant run -Daction=store and I get the following exception:

what is wrong?

Also i am running eclipse 3.2 is there an easy way to integrate this simple example with eclipse 3.2?


Hibernate.cfg.xml:


<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="connection.url">jdbc:sqlserver://lonisi106/SQLExpress</property>


Hibernate version: 3


[java] 11:59:17,076 WARN SettingsFactory:103 - Could not obtain connection metadata
[java] com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.UnknownHostException:
[java] at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
[java] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
[java] at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:512)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:140)


SQL Server 2005


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 7:37 am 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
Can you ping to lonisi106?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 8:12 am 
Newbie

Joined: Fri Aug 18, 2006 6:47 am
Posts: 11
yes i can.

Database Instance Name is SQLExpress running on said server, and the Database name is Test, its an sql server 2005 DB running on port 1433

I have changed the cofig file somewhat, here is what the new property name now looks like:

<property name="connection.url">jdbc:sqlserver://lonisi106\SQLExpress:1433;DatabaseName=Test</property>

I am getting an error that looks like this now:

[java] 13:00:23,430 INFO DriverManagerConnectionProvider:86 - connection properties: {user=sa, password=****}
[java] 13:00:23,531 WARN SettingsFactory:103 - Could not obtain connection metadata
[java] com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'.
[java] at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
[java] at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
[java] at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
[java] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)



I assume that where it says password, that is just a standard 4 character asterik?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 8:26 am 
Newbie

Joined: Fri Aug 18, 2006 6:47 am
Posts: 11
I just tried to connect to a DB running on a different server where only one DB is running on that server, it worked fine, it seems to be a problem with the escape character before the instance i.e.:

lonisi108\SQLExpress:

the middle slash above, so i changed it to:

lonisi108\\SQLExpress:

and im still getting failed login.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 11:22 am 
Newbie

Joined: Fri Aug 18, 2006 6:47 am
Posts: 11
this is now working.


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.