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
posted
0
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.
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?
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
posted
0
All tables have dbo. prefix. I suppose that is the schema.
michael tall
Ranch Hand
Joined: Nov 02, 2008
Posts: 61
posted
0
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
posted
0
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.