import javax.servlet.jsp.jstl.sql.Result;
import javax.servlet.jsp.jstl.sql.ResultSupport;
import mapper.dbConnection;
/**
*
* @author Burak AMASYALI
*/
public class TableBean {
public Result getPerInfoAll() {
try {
return ResultSupport.toResult(dbConnection.returnResult("select * from myTable"));
} catch (Exception ex) {
return null;
}
}
}
public static ResultSet returnResult(String sqlquery) throws Exception {
//Bir sorgunun result'unu dönderen fonksyon.
PreparedStatement ps;
try {
ps = getCon().prepareStatement(sqlquery);
ResultSet rs = ps.executeQuery();
return rs;
} catch (SQLException ex) {
throw ex;
}
}
The Man Who Loved Algorithm&Ubuntu.
www.burakamasyali.com
|