Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7861897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:55:21+00:00 2026-06-02T22:55:21+00:00

I keep getting an ‘invalid object name’ connecting to a hosted SQL Server 2008

  • 0

I keep getting an ‘invalid object name’ connecting to a hosted SQL Server 2008 in my application. I can query the DB from the app using a string. However whenever I use Hibernate I get this error

//Calling Class
SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
Transaction tx = session.beginTransaction();
session.save(survey);
tx.commit(); <!--Blows up-->
session.close();


<hibernate-configuration>
<session-factory name="Persist">
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.password">xxxx</property>
<property name="hibernate.connection.url">jdbc:sqlserver://xxxx</property>
<property name="hibernate.connection.username">xxxx</property>
<property name="hibernate.default_catalog">xxxx</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServer2008Dialect</property>
<mapping class="com.springmvc.dao.Survey" resource="com/springmvc/dao/Survey.hbm.xml"/>
</session-factory>
</hibernate-configuration>

//Table Mapping
<hibernate-mapping>
<class name="com.springmvc.dao.Survey" table="Survey">
    <id name="SurveyId" type="int">
        <column name="SURVEYID" />
        <generator class="assigned" />
    </id>
    <property name="SurveyName" type="java.lang.String">
        <column name="SURVEYNAME" />
    </property>
    <property name="CreateDate" type="java.sql.Date">
        <column name="CREATEDATE" />
    </property>
    <property name="IsActive" type="boolean">
        <column name="ISACTIVE" />
    </property>
</class>
</hibernate-mapping>

//The Error
org.hibernate.exception.SQLGrammarException: could not insert: [com.springmvc.dao.Survey]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Recruiter.Survey'.

Can any one tell me what is going on and how to fix it, It has to be a Hibernate problem. I have tried to add a scheme then I get an error saying that Recruiter.dbo.Survey is not allowed. There are no more config file to look over and google has supplied me w/ anything useful. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:55:22+00:00Added an answer on June 2, 2026 at 10:55 pm

    Your primary key SurveryId is having the generator class as “assigned”, you need to assign the key before calling Save in hibernate session. Are you doing that? If you dont want to generate then make it auto generated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this statement Invalid use of group function for this query mysql_query(UPDATE
I keep getting this NPE in my application and I can't seem to get
I keep getting the following error: * #1005 - Can't create table 'classorganizer.turma' (errno:
I keep getting a 500 Internal Server Error when using the following Rewrite rule
I keep getting a Compilation Error and can't find matching overloaded method. I've tried
I keep getting bad pointers. Can anyone tell me what am I doing wrong?
I keep getting this error Object reference not set to an instance of an
I keep getting tasks that are above my skill level. How can I address this without coming accross as grossly incompetent?
I keep getting a PermGen error on my Tomcat 6 server. I know what
I keep getting a exception when I try to FTP to my Win 2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.