File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL Server 2005 Express error logs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Server 2005 Express error logs" Watch "SQL Server 2005 Express error logs" New topic
Author

SQL Server 2005 Express error logs

michael tall
Ranch Hand

Joined: Nov 02, 2008
Posts: 61
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

Joined: Nov 02, 2008
Posts: 61
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

Joined: Apr 14, 2004
Posts: 10336


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?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
michael tall
Ranch Hand

Joined: Nov 02, 2008
Posts: 61
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

Joined: Apr 14, 2004
Posts: 10336

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

Joined: Nov 02, 2008
Posts: 61
All tables have dbo. prefix. I suppose that is the schema.
michael tall
Ranch Hand

Joined: Nov 02, 2008
Posts: 61
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

Joined: Nov 02, 2008
Posts: 61
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.
 
Consider Paul's rocket mass heater.
 
subject: SQL Server 2005 Express error logs