Callable statements, SQLServer and JRun

Callable statements, SQLServer and JRun

Post by cormac.fol » Wed, 14 Feb 2007 05:23:06


Hi,

I'm developing a java application which uses SQL Server as the
database. I use Callable Statements to connect to the database. I use
JRun as the app server. When
running the application I want to be able to monitor locks/process
info etc in the 'Current Activity' section in the 'Management'
section
in SQL Server.


The problem is that at the moment if I look at the 'Last TSQL command
batch' in the process or lock, it does not display the sql for the
current call. It displays what seems to be the precompiled call:
#jdbc#9;1


Anyone know how to get it to display the sql?


Is it a driver issue or is there a SQL Server setting to get it to do
this?


Thanks
 
 
 

Callable statements, SQLServer and JRun

Post by cormac.fol » Wed, 14 Feb 2007 05:23:23

Hi,

I'm developing a java application which uses SQL Server as the
database. I use Callable Statements to connect to the database. I use
JRun as the app server. When
running the application I want to be able to monitor locks/process
info etc in the 'Current Activity' section in the 'Management'
section
in SQL Server.


The problem is that at the moment if I look at the 'Last TSQL command
batch' in the process or lock, it does not display the sql for the
current call. It displays what seems to be the precompiled call:
#jdbc#9;1


Anyone know how to get it to display the sql?


Is it a driver issue or is there a SQL Server setting to get it to do
this?


Thanks

 
 
 

Callable statements, SQLServer and JRun

Post by Erland Som » Wed, 14 Feb 2007 07:29:09


( XXXX@XXXXX.COM ) writes:

Didn't you ask the same question a week ago or two? Yes, that was
another newsgroup, but at least you should have learnt by now that it
is a driver issue. And I hope that you should know that you should
use parameterised statements.

Well, I see on Google Groups that you also have posted your
question to comp.lang.java.programmer. Too that you did not cross-post.
It would have been interesting to see the answers from the Java folks.

--
Erland Sommarskog, SQL Server MVP, XXXX@XXXXX.COM

Books Online for SQL Server 2005 at
http://www.yqcomputer.com/
Books Online for SQL Server 2000 at
http://www.yqcomputer.com/
 
 
 

Callable statements, SQLServer and JRun

Post by cormac.fol » Wed, 14 Feb 2007 08:37:48


He he..u the newsgroup police or something? Yes I asked the same
question last week on Yahoo. Am interested in getting numerous
opinions on this.

I have tried a number of different types of driver and all of them
still result in the compiled sql in the 'Last TSQL command batch'
value. Interestingly when I use Microsoft drivers they seem to compile
everything..and Macromedia drivers just seem to compile stored
procedure calls which have parameters.

I need to use stored procedures/CallableStatements - it may be that is
not possible to have the uncompiled sql available in the log when
using CallableStatements no matter what driver I use.