Is that OK to store query Result in String 2 Dimension ?
Is that OK to store the result of query in String 2 dimension ?
im a litle bit confuse about the return value of this method. If i user ResultSet, the ResultSet need to be close. But if the ResultSet is closed, i cannot read data. So i think maybe i should use the String[][]. Is thar ok if it use for high scale application ?
public String[][] selectQuery(String query)throws SQLException
{
recordset=new String[10][30];
Statement select=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs=select.executeQuery(query);
rsmd=rs.getMetaData();
z=0;
while(rs.next())
{
for(int i=1;i<=rsmd.getColumnCount();i++)
{
recordset[i][z]=rs.getString(i);
}
z++;
}
rs.close();
select.close();
return
recordset;
}

