-->
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.  [ 1 post ] 
Author Message
 Post subject: DataSource problem:How can i specify the specific database?
PostPosted: Wed Oct 05, 2005 10:31 pm 
Newbie

Joined: Sun Aug 14, 2005 6:07 am
Posts: 14
Location: China
I use MS SQL Server 2000 as database.

My Tomcat5.0 deployment is as below:

Data Source URL:
jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=Hibernate (This is the database name which i want to specify)

JDBC Driver Class:
com.microsoft.jdbc.sqlserver.SQLServerDriver


But when i run my hibernate examples,it shows:net.sf.hibernate.JDBCException: Could not save object


I try to copy the tables into the MS SQL Server 2000 default database:Northwind.

Then i run the examples anain,this time,the objects are saved into the tables in the Northwind correctly.

How strange,I have never specified the datasource to Northwind,however,i have specified the datasource to Hibernate,why the operations are all pointing to the Northwind?

Who can tell me how and when can i specify the database?
If i specify it in the Tomcat Datasource deployment,it seems not flexible,bucause i can't change in my application.
So i want to specify it in my application code.

How can i do?

_________________
Confidence,Persistence & Endurance lead to Success!


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

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.