rish1690
rish1690

Reputation: 291

Schema Name Sql server from java jdbc connection

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 ?

Upvotes: 1

Views: 1464

Answers (1)

Leos Literak
Leos Literak

Reputation: 9474

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

"{call schema.TEST_PROC(?,?)}"

Upvotes: 2

Related Questions