1

i am trying to call stored procedures from java using jdbc conenction to connect sql server

String storedProcd = "{call TEST_PROC(?,?)}";
callableStatement = dbConnection.prepareCall(storedProcd);
callableStatement.setInt(1, id);
callableStatement.setString(2, Entityname);
callableStatement.execute();
callableStatement.close();

problem is that i cant set schema name in JDBC url,it works fine if my Stored procuders are in default schema that is dbo but what if my stored procedures are in other schema ?

1
  • 1
    hi thanks Leos ,working fine .Please post it as answer Commented Apr 22, 2014 at 4:46

1 Answer 1

2

As any SQL resource you can prefix procedure name with schema name:

"{call schema.TEST_PROC(?,?)}"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.