<html><div style='background-color:'><DIV>
<P>
<TABLE cellSpacing=1 cellPadding=4 width="100%" bgColor=#666699 border=0>
<TBODY>
<TR bgColor=#ddddff>
<TD><FONT size=4></FONT></TD></TR>
<TR bgColor=#ffffff>
<TD><FONT size=4>Hi All,<BR><BR>I would like to know how i can pass String[] to function. To give a clearer idea i have to code below. <BR>I am using PostgreSQL 7.3.<BR><BR>Any help regarding this is appreciated.<BR><BR><BR>Thanks in advance,<BR>Nagesh <BR><BR><BR>class testArray {<BR>public static void main(String args[]) {<BR>test();<BR>}<BR><BR><code><BR>static void test()<BR>{<BR><BR>String url = "jdbc:postgresql://myDB:5432/dbinstance";<BR>String query="{call test_mohan(?)}";<BR>Connection con = null;<BR>CallableStatement stmt=null;<BR>try {<BR>Class.forName("org.postgresql.Driver");<BR>con=DriverManager.getConnection(url,"blah", "blah"); <BR>String string[]=new String[]{"hi","hello"};<BR>//not sure how to use string array above and pass to setArray below or use another solution<BR><BR>stmt.setArray(1, );<BR>stmt = con.prepareCall(query);<BR>ResultSet rs=stmt.executeQuery();<BR>while(rs.next())<BR>{<BR>.....<BR>}<BR><BR>} catch(Exception ex) {<BR>System.out.println
("Get Data Fail: " + ex);<BR>}<BR>finally{<BR>........<BR>}<BR>}<BR>}</FONT></TD></TR></TBODY></TABLE><BR><BR></P></DIV></div><br clear=all><hr>MSN 8 with <a href="http://g.msn.com/8HMEENUS/2740">e-mail virus protection service: </a> 2 months FREE*</html>