Hi All,

I would like to know how i can pass String[] to function. To give a clearer idea i have to code below.
I am using PostgreSQL 7.3.

Any help regarding this is appreciated.


Thanks in advance,
Nagesh


class testArray {
public static void main(String args[]) {
test();
}

<code>
static void test()
{

String url = "jdbc:postgresql://myDB:5432/dbinstance";
String query="{call test_mohan(?)}";
Connection con = null;
CallableStatement stmt=null;
try {
Class.forName("org.postgresql.Driver");
con=DriverManager.getConnection(url,"blah", "blah");
String string[]=new String[]{"hi","hello"};
//not sure how to use string array above and pass to setArray below or use another solution

stmt.setArray(1, );
stmt = con.prepareCall(query);
ResultSet rs=stmt.executeQuery();
while(rs.next())
{
.....
}

} catch(Exception ex) {
System.out.println ("Get Data Fail: " + ex);
}
finally{
........
}
}
}




MSN 8 with e-mail virus protection service: 2 months FREE*