[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Changing MS SQL password using JDBC and stored procedure

Posted on 2004-04-15
4
Medium Priority
?
601 Views
Last Modified: 2012-05-04
Hi, I'm trynig to write a method that changes a user's password in MS SQL Server. I understand that the stored procedure to call is sp_password. The following code returns a JDBC error:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).

Any help would be appreciated.

CallableStatement cs = con.prepareCall("{ call sp_password(?,?,?) }");
cs.setString(0,oldPassword);
cs.setString(1,newPassword);
cs.setString(2,userName);
cs.execute();
0
Comment
Question by:matthew_york
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
mmuruganandam earned 750 total points
ID: 10831584
setString should start from 1 not from 0.

Regards,
Muruga
0
 
LVL 1

Author Comment

by:matthew_york
ID: 10831641
Thanks, that got over that problem but now i get a message:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 1: Incorrect syntax near '{

I'm sure this must be something simple. Thanks in advance.
0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10831652
this could be a problem with your stored procedure.

check your "sp_password" procedure.  compile it for errors.
0
 
LVL 1

Author Comment

by:matthew_york
ID: 10831692
thanks for your help
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question