Skip to content

Instantly share code, notes, and snippets.

@rj-hwang
Created July 20, 2015 07:06
Show Gist options
  • Save rj-hwang/66fa895024c957409e0c to your computer and use it in GitHub Desktop.
Save rj-hwang/66fa895024c957409e0c to your computer and use it in GitHub Desktop.
ResultSet to Object[]
public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException {
Object[] r = new Object[rs.getMetaData().getColumnCount()];
for (int i = 0; i < r.length; i++) {
r[i] = rs.getObject(i + 1);
}
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment