Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to invoke java code

Author  Topic 

vinay789
Starting Member

40 Posts

Posted - 2010-01-20 : 00:29:14
Hi to all,
I am using sql server 2008 db performing job scheduling task in this job scheduling i want to invoke java code in which this will generate a jfree chart at run time and this chart will sent to the customers list from my db can any one tell me how to invoke java code by using T-SQL Script. Thanks in advance.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-20 : 01:07:37
use job step type operating system command

i must say though, this doesn't seem like the best idea i've ever heard...may be better to use application server to fire off your compiled app
Go to Top of Page

vinay789
Starting Member

40 Posts

Posted - 2010-01-20 : 01:40:04
Hi
Thanks for ur reply but i am little bit confused how to implement ur idea can u pls elabourate how to do this. Thanks in advance
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-01-20 : 02:11:36
Go for xp_cmdshell

xp_cmdshell 'yourprogram.jar'

For more info :http://msdn.microsoft.com/en-us/library/aa260689(SQL.80).aspx

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-20 : 08:45:19
you said " am using sql server 2008 db performing job scheduling task in this job scheduling"

this means you are, or should be, using SQL Server Agent to create a scheduled job.

When you create the job step that should execute your compiled code, you make it type operating system command and place the path to your executable in the command section -- exactly as you would call it from a command prompt or a batch file.

the sql agent account will need permission to execute the program
Go to Top of Page
   

- Advertisement -