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 2000 Forums
 SQL Server Development (2000)
 RMI using Xp_cmdshell

Author  Topic 

ravis
Starting Member

7 Posts

Posted - 2009-06-01 : 03:37:56
Hi,

I want to run jar file which is reside on remote server using Xp_cmdshell. I tried the following approach , but it is not able to succeed.


xp_cmdshell "cd RMI

xp_cmdshell set path=c:\jdk1.6.0_10\bin

xp_cmdshell 'java RmiClient 172.10.3.114 3232 java -jar /Users/laser/Desktop/RMI/XML_Creator.jar'"

it gives error as,
Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with 'cd
xp_cmdshell cd RM

xp_cmdshell set path=c:\jdk1.6.0_10\bin

xp_cmdshell 'java RmiClient 172.10.3.114 3232 java -jar ' is too long. Maximum length is 128.

Any one help on this.
Thanks in advance.

RAVIS

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-01 : 04:33:52
Ravi,

Combine all the statement as a batch file, ask mohan to create a batch file, and execute a .bat file using xp_cmdshell


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-01 : 04:35:58
xp_cmdshell the statements are not persistent.

When you execute the first statement xp_cmdshell "cd RMI" that command is only good for the duration of the xp_cmdshell call therefore when you execute the next command xp_cmdshell "c:\jdk1.6.0_10\bin" the cd RMI is no longer valid.


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-01 : 04:37:51
Soething similar to http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=126431

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-01 : 04:38:54
quote:
Originally posted by senthil_nagore

Ravi,

Combine all the statement as a batch file, ask mohan to create a batch file, and execute a .bat file using xp_cmdshell


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


Who is mohan?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-01 : 04:39:24
Not similar, the same project they continue!


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-01 : 04:40:25
he is front end programmer in my ex-team!


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

ravis
Starting Member

7 Posts

Posted - 2009-06-01 : 06:23:14
Hi Senthil,Madhivanan

I got it and it is working now.
Thanks.

Ravi.S
Go to Top of Page
   

- Advertisement -