July 24, 2009 at 8:13 am
Hi,
We recently installed the new JDBC driver 2.0 because we were unable to connect to Sql Server 2008 via our java application. Apparently that problem is taken care of but now we are receiving this error:
[font="Arial Black"]Thread-19 | Thu Jul 23 16:59:26 EDT 2009 | LOG_ERROR | Exception(Failed to execute sql stored procedure({call xxxxxx(?,?)}). Error(Executing SQL directly; no cursor.))
Thread-19 | Thu Jul 23 16:59:26 EDT 2009 | LOG_DEBUG | com.xxxx.mfw.util.Exception: Failed to execute sql stored procedure({call should_task_script_run(?,?)}). Error(Executing SQL directly; no cursor.)
at [/font]
(This is the beginning of a java stack trace. I am not a java person but I am including the part with the error message in case it is helpful.)
I am attaching a snippet also of the sql code that is being called. It only has t-sql queries in it. There are no cursors (implicit or explicit, as far as I can tell.)
[font="Arial Black"]DECLARE @v_should_run INT,
@v_begin_cnt INT,
@v_end_cnt INT
/* check that no other script has an error outstanding */
/* If so, return @p_answer_flg of 0 (shoould not run) */
SELECT @v_should_run = 1 - SIGN(COUNT(*)) /* 1 if COUNT(*) = 0, else 0 */
FROM mig_task
WHERE mig_run_id = (SELECT MAX (mig_run_id) FROM mig_run)
AND task_seq_nbr = 0
AND task_script_name != @p_task_script_name
AND task_status > 0
IF @v_should_run = 0
BEGIN
SET @p_answer_flg = 0
RETURN
END
/* set @v_should_run > 0 if no task elements of the script have run */
/* or if there was an error in a previous run */
SELECT @v_should_run = ISNULL(MAX(task_status), 1)
FROM mig_task
WHERE mig_run_id = (SELECT MAX (mig_run_id) FROM mig_run)
AND task_seq_nbr = 0
AND task_script_name = @p_task_script_name [/font]
If you need more info, let me know. I would appreciate any leads as I don't know what the issue might be. Also, reverting back to the old jdbc driver is not an option since we need to support our product on SS2008.
Thank you!!
July 24, 2009 at 8:48 am
Also, reverting back to the old jdbc driver is not an option since we need to support our product on SS2008.
Sorry, I don't have an answer, but a suggestion. If this seems like a SS2008 problem, perhaps posting in the SS2008 section would get you more expertise in that area.
July 24, 2009 at 9:00 am
The error we are seeing is when we try to connect to SS2005. We upgraded the driver so that our customers on SS2008 could also use our product, but the error I am reporting is being seen with JDBC driver 2.0 connecting to SS2005.
July 24, 2009 at 9:09 am
Ahh, I see. Thanks.
June 14, 2010 at 10:38 am
Check this article HOW TO SQL in JAVA for details on how to connect to SQL Server database from C#.NET database applications as well as Java database applications. It also describes how to pass embedded SQL queries (SELECT, INSERT, UPDATE, DELETE), calling stored procedures, pass parameters etc.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply