All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.icymint.libra.jdbc.result.ArrayResultMap Maven / Gradle / Ivy

package me.icymint.libra.jdbc.result;

import java.sql.ResultSet;
import java.sql.SQLException;

import me.icymint.libra.jdbc.JdbcAccessException;

/**
 * Object数组查询结果,其从ResultSet中查询一条记录,并返回成Object数组对象。
 * 
 * @author Daniel Yu
 * @since 2013-3-14
 * 
 */
public class ArrayResultMap implements ResultMap {

	@Override
	public Object[] handle(ResultSet rs, int index) throws JdbcAccessException {
		try {
			Object[] res = new Object[rs.getMetaData().getColumnCount()];
			for (int i = 1; i <= res.length; i++) {
				res[i - 1] = rs.getObject(i);
			}
			return res;
		} catch (SQLException e) {
			throw new JdbcAccessException(e);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy