Microsoft
Software
Hardware
Network
Question : Java invalid syntax error passing variables to SP
Hello experts,
I am receiving a syntax error when trying to pass a variable to a SQL stored procedure.
Here is the java call: (The reason it doesnt look standard is because I'm running in a JSP that has it's own java functions etc).
var dbConn = DatabaseConnectionFactory.
createData
baseConnec
tion ('net.sourceforge.jtds.jdb
c.Driver',
'jdbc:jtds
:sql server://localhost:1433/DB
;instance=
MSSQLSERVE
R','sa','P
W');
var result = 0;
var sql = "exec dbo.mirth_test_insert_2('0
')"; // this is the line in question
result = dbConn.executeUpdate(sql);
globalMap.put('PER_NBR', result)
dbConn.close();
return message;
I get the error "Is getting this error in log: Wrapped java.sql.SQLException: Incorrect syntax near '(' " etc.
Thoughts?
Thanks in advance
Answer : Java invalid syntax error passing variables to SP
need to use callablestatement?
Random Solutions
Worldspan - calling worldspan web service
How to re-write code using strings to Delphi 2010
What are some good guides on designing and building video games
speak & auto type?
How can I uninstall a corrupt broadcom driver?
Operator '=' is not defined for type 'DBNull' and type 'Integer' - how to fix
EMC DPA (Data Protectiopn Advisor) Report
QOS And routing behind a bridged device on Cisco 2800 series router
riddle vb.net calling unmanaged c++ dll
ACT 2009! registration error, windows 7 (exception error popup)