Hii,
I am an query??
Following is my java code for database coonectivity through web service:
package net.org;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Properties;
public class ConnectUpdateAmt {
int i;
public String updateBalance(String card1,String balAmt)
{
String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=fApplication";
String user="sa";
String password="ftl@123";
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
Connection connection = DriverManager.getConnection(connectionUrl,user,pas sword);
String sql = "{ call dbo.updateBalance(?,?) }";
CallableStatement cstmt =connection.prepareCall(sql);
cstmt.setString(1,card1);
cstmt.setString(3,balAmt);
i= cstmt.executeUpdate();
}
catch(Exception exc){
System.out.println(exc.getMessage());
}
if(i==1)
{return "Success";}
else {
return "unSuccess";}
}
}
And I am using stored procedure for the same through SQL Server,
My table contains three columns:name,fingerprint and balamt.
All three are varchar .
i am using same steps for insert,select.
but getting error in update.
Plz help me for the same.