Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jdbc question

Status
Not open for further replies.

djam

Technical User
Nov 15, 2002
223
CA
I have a jdbc question,

I have a stored procedure that I'm calling that requires as a parameter an array. Is this the correct syntax?

int[] myArray = new int[2];

myArray[0] = 0;
myArray[1] = 1;

String command = "select getquote('"+myArray+"')";
Statement stmt =con.createStatement();
ResultSet rs = stmt.executeQuery(command);


thanks " ahhh computers, how they made our lives much simpler ;) "
 
>> I have a stored procedure that I'm calling that requires
>> as a parameter an array.

Post that stored procedure. I've never seen an "array" type parameter in a stored procedure.

String command = "select getquote('"+myArray+"')";

That certainly will NOT work.

-pete
 
CREATE FUNCTION getquote (integer[]) RETURNS integer AS
'declare

begin

return 1;

end;
'LANGUAGE'plpgsql'; " ahhh computers, how they made our lives much simpler ;) "
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top