-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate and MSSQL 2000
PostPosted: Mon Sep 08, 2008 3:10 am 
Newbie

Joined: Mon Sep 08, 2008 3:01 am
Posts: 3
Hi all,

I have a code like this:

Code:
try {
         Session session = HibernateManager.getInstance().getSession();
         Customer customer = new Customer();
         customer.setCustomerId(1);
         customer.setCompanyName("My company");
         session.save(customer);
         System.out.println("Done");
         session.flush();
         session.close();
         
      } catch (Exception e) {
         // TODO: handle exception
      }


when execute i got the error as following:
Code:
java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to Northwind
   at com.microsoft.jdbc.base.BaseWarnings.createSQLWarning(Unknown Source)
   at com.microsoft.jdbc.base.BaseWarnings.get(Unknown Source)
   at com.microsoft.jdbc.base.BaseConnection.getWarnings(Unknown Source)
   at org.hibernate.util.JDBCExceptionReporter.logAndClearWarnings(JDBCExceptionReporter.java:22)
   at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:449)
   at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:385)
   at org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:324)
   at org.hibernate.impl.SessionImpl.close(SessionImpl.java:298)
   at mine.hibernate.impl.ContactManager.updateABC(ContactManager.java:30)
   at mine.hibernate.impl.ContactManager.main(ContactManager.java:47)


And data not inserted into database.
Could anyone tell me why? and how to overcome this issue?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 8:04 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Are you actually testing against the sample Northwind database?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.