Java tutorial
//package com.java2s; import java.sql.ResultSet; public class Main { public static byte[] getBytes(ResultSet rs) throws Exception { byte[] res = {}; int col = rs.getMetaData().getColumnCount(); for (int i = 1; i <= col; i++) { System.out.println(i + ":" + rs.getMetaData().getColumnTypeName(i)); byte[] obj = {};//rs.getBytes(i); byte[] n = new byte[res.length + obj.length]; System.arraycopy(res, 0, n, 0, res.length); System.arraycopy(obj, 0, n, res.length, obj.length); res = n; } return res; } }