1

So I connected to "Microsoft SQL Server 2008 R2 " through Netbeans and then loaded all my entities.I followed the "https://netbeans.org/kb/docs/web/jsf20-crud.html#createDB" tutorial to create some basic JSF's. It is working fine for all entities.But one of my entity name is "User" so when I try "Show all User Items" it gives me this error.

"Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'User'."

I tried to google this error and read in one of the posts that since "User" is a keywork I need to escape the name in the jpa.entities and make it @Table("\"User\"").I tired this also and it did not work.

I am new to using JSF's and working with netbeans and databases.Could you let me know what is causing this issue.Thanks.

1
  • Also to add when I use escape characters like mentioned above it throws an error saying "Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name" Commented Aug 16, 2013 at 15:21

1 Answer 1

2

User is reserved word of SQLServer database, so you can't name your table with it. As group or role... You could try use "Users" that will work fine!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.