一些基础的关于java jdbc的程序代码
public Object getValueAt(int rowIndex, int columnIndex) {
return datavalues[rowIndex][columnIndex];
}
public String getColumnName(int column) {
return columnHeaders[column];
}
public void setDatavalues(Object[][] datavalues) {
this.datavalues = datavalues;
}
}
5操作方法
package edu;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
public class CountryOperate {
static int i = 1;
static int x = 0;
public static List<Country> queryFirst() {
String sql = "select top 5 * from bbc order by name";
List<Country> list = query(sql);
return list;
}
public static List<Country> downPage() {
int y = queryCount();
List<Country> list = null;
int count = 0; // 总页数
if (y % 5 == 0) {
count = y / 5;
} else {