Vote count:
0
I am newbie to postgre db.My requirement is to pass int array as parameter to sql query through prepared statement.
Below is my query: I tried to pass the array like below.but that generate exception.
PreparedStatement cstmt1 = dbconnection.prepareStatement("select * from GenerateTranscript(?)");
Array sqlArrayq = dbconnection.createArrayOf("int4", new Integer[] { 1,2,3 });
cstmt1 .execute();
But when i give like below.my query executes
PreparedStatement cstmt1 = dbconnection.prepareStatement("select * from GenerateTranscript(Array[1,2,3)");
How to pass the integer array for my postgresql using prepared statement.
Any help will be greatly appreciated!!!
asked 36 secs ago
How to pass array in preparedstatement in postgresql
Aucun commentaire:
Enregistrer un commentaire