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

  • SEARCH
  • Home
  • 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 8325291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:22:55+00:00 2026-06-09T00:22:55+00:00

I want to do get data from sql server database so I use to

  • 0

I want to do get data from sql server database so I use to jdbc driver and eclipselink orm framework.I have some problem.This is my example,

public static void main(String[] args)
{
        EntityManager entityManager =  
                Persistence.createEntityManagerFactory("HRPSPU").createEntityManager();

        List<Personnel> personnelList = entityManager.createQuery("Select p FROM Personnel p",Personnel.class).getResultList();

        for (Personnel personnel : personnelList)
        {
                System.out.println(personnel.getName());
        }
    }

and error,

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/E:/tutorial/glassfish3/glassfish/modules/bean-validator.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/E:/tutorial/glassfish3/glassfish/modules/weld-osgi-bundle.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Tem 31, 2012 11:44:51 PM org.hibernate.validator.util.Version <clinit>
INFO: Hibernate Validator 4.2.0.Final
[EL Info]: 2012-07-31 23:44:51.929--ServerSession(451764492)--EclipseLink, version: Eclipse Persistence Services - 2.4.0.v20120608-r11652
[EL Info]: connection: 2012-07-31 23:44:52.951--ServerSession(451764492)--file:/E:/tutorial/workspace/HRPS/build/classes/_HRPSPU login successful
[EL Warning]: 2012-07-31 23:44:53.927--UnitOfWork(1400947054)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
**Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Personnel'.**
Error Code: 208
Call: SELECT IdentificationNumber, Age, Name, Surname FROM Personnel
Query: ReadAllQuery(referenceClass=Personnel sql="SELECT IdentificationNumber, Age, Name, Surname FROM Personnel")
Exception in thread "main" Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Personnel'.
Error Code: 208
Call: SELECT IdentificationNumber, Age, Name, Surname FROM Personnel
Query: ReadAllQuery(referenceClass=Personnel sql="SELECT IdentificationNumber, Age, Name, Surname FROM Personnel")
    at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:646)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:537)
    at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1800)
    at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:566)
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:264)
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:648)
    at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2681)
    at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2634)
    at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:420)
    at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1149)
    at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:852)
    at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1108)
    at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:392)
    at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1196)
    at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2875)
    at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1602)
    at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1584)
    at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1549)
    at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:231)
    at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:411)
    at entity.Main.main(Main.java:18)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Personnel'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:285)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:938)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:609)
    ... 22 more

and this is my persistance.xml,I connected integratedsecurity=true so i didnt have a user name and password…

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
        <persistence-unit name="HRPSPU" transaction-type="RESOURCE_LOCAL">
             <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
            <class>entity.Personnel</class>
         <properties>
          <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost:1433;databaseName=Arge;integratedSecurity=true;"/>
          <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
          <property name="javax.persistence.jdbc.password" value=""/>
          <property name="javax.persistence.jdbc.user" value=""/>
         </properties>
        </persistence-unit>
    </persistence>

I use to Eclipse Juno IDE and Glassfish application server.

  • 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-09T00:22:58+00:00Added an answer on June 9, 2026 at 12:22 am

    I have a one database and schema.My table is inside by this schema.I connect to localhost.

    package entity;

    import java.io.Serializable;
    import javax.persistence.*;
    
    
    /**
     * The persistent class for the Personnel database table.
     * 
     */
    @Entity
    @Table(name="Personnel")
    public class Personnel implements Serializable {
        private static final long serialVersionUID = 1L;
    
        @Column(name="Age")
        private short age;
    
        @Column(name="IdentificationNumber")
        @GeneratedValue
        @Id
        private long identificationNumber;
    
        @Column(name="Name")
        private String name;
    
        @Column(name="Surname")
        private String surname;
    
        public Personnel() {
        }
    
        public short getAge() {
            return this.age;
        }
    
        public void setAge(short age) {
            this.age = age;
        }
    
        public long getIdentificationNumber() {
            return this.identificationNumber;
        }
    
        public void setIdentificationNumber(long identificationNumber) {
            this.identificationNumber = identificationNumber;
        }
    
        public String getName() {
            return this.name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public String getSurname() {
            return this.surname;
        }
    
        public void setSurname(String surname) {
            this.surname = surname;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to work with data that I get from a SQL Server database
In my iPhone project,I use Odata Service to get data from SQL Server database
I have one problem , I want to get some data from XML file
I want to get data from mysql database with the help of DataImportHandler so
I want to get data from two tables. I have patient first name and
I want to get data from a table in my MySQL database. $linkID =
Whenever I want to get data from a plist file I use the following
I am using http://lite.facebook.com And i want to get some data from my account.
I'm developing an application that reads data from a SQL server database (migrated from
I need to get a Date from an SQL Server Database (SQL Server 2000),

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.