win006
07-07-2005, 01:37 AM
Hai
I need some help regarding calling stored procedures,I am using mysql server 2000 and i wrote a stored procedure
CREATE PROCEDURE fetchArtists @artist_id int
AS
begin
select * from Artists where artist_id=@artist_id
end
GO
and i am executing it from java using callable statement
CallableStatement stmt=con.prepareCall("{call fetchArtists(1)}");
ResultSet result=stmt.executeQuery();
while(result.next())
{
name1=result.getString(1);
homebase1=result.getString(2);
style1=result.getString(3);
art=result.getInt(4);
}
This is working fine
but i would like how to pass some dynamic input,instead of 1 i would like to input something dynamically into call fetchArtists(1)
I tried by taking i value and incrementing value using loop but i getting error of this sought
Errorjava.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
Please help
Thank U
I need some help regarding calling stored procedures,I am using mysql server 2000 and i wrote a stored procedure
CREATE PROCEDURE fetchArtists @artist_id int
AS
begin
select * from Artists where artist_id=@artist_id
end
GO
and i am executing it from java using callable statement
CallableStatement stmt=con.prepareCall("{call fetchArtists(1)}");
ResultSet result=stmt.executeQuery();
while(result.next())
{
name1=result.getString(1);
homebase1=result.getString(2);
style1=result.getString(3);
art=result.getInt(4);
}
This is working fine
but i would like how to pass some dynamic input,instead of 1 i would like to input something dynamically into call fetchArtists(1)
I tried by taking i value and incrementing value using loop but i getting error of this sought
Errorjava.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
Please help
Thank U