Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Server 2005 Express error logs

 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me how to look up the SQL Server error logs? An update query is not executing from Java application. It is working fine when I am directly entering the query in SQL Server query window.
If I know the log file, I can see the recorded messages based on the time of application execution
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat error logs have the following information
ASSIGNMENT is the table name. I was able to add records to the same table using a Java application.
The sql statement used (which threw above exception) is:
Another (maybe unrelated to this problem) piece of information I observed is: For connecting to the database I am not using database name anywhere: All I am using is
database driver:
database url:
database user and password
I tried to append database name to the url after port number but received error messages; so I proceeded without mentioning database name anywhere in configuration or code.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I tried to append database name to the url after port number but received error messages; so I proceeded without mentioning database name anywhere in configuration or code.

This means you are connecting to the default database for whichever user you are connecting as. Try executing sp_who2 in SQL Server to see what database you are actually connected to. My guess is master.

You should be able to define the database to connect to in your URL. Can you post the URL you used?
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I executed sp_who2 and found the database as dramboit (which is the database that has all my tables).
URL is jdbc:sqlserver://localhost:1234
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you connecting with a user than can see these tables? If they were created in a different schema you will need grants on them.
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All tables have dbo. prefix. I suppose that is the schema.
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the SQL statement as dbo.ASSIGNMENT. It still doesn't work. Maybe I should create a new user and grant fresh permissions to make it work. Thanks.
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. You are 100 per cent correct. I created a new database user and granted all required permissions. Same code worked without any problems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic