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

org.nutz.dao.impl.sql.callback.QueryStringCallback Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
package org.nutz.dao.impl.sql.callback;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;

import org.nutz.dao.sql.Sql;
import org.nutz.dao.sql.SqlCallback;

/**
 * 返回 String 列表
 * 
 * @author zozoh([email protected])
 */
public class QueryStringCallback implements SqlCallback {

    public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
        List list = new LinkedList();
        while (rs.next())
            list.add(rs.getString(1));
        return list;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy