不会吧,就是数据库的配制啊,还有连结啊,可以的啊,你慢慢学啊!
好,我下面演示一下用JDBC访问ACCESS数据库的例子!
import java.sql.*
public class databaseaccess{
public static void main(String[] args){
String dbdriver ="sun.jdbc.odbc.jdbcodbcdriver";
string connstr="jdbc
dbc:Employee";
string sql="select * from person"//update ,delete,insert into ,OK!
Connection conn=null;
ResultSet rs=null;
try{
Class.forName(dbdriver);//add database's driver;
conn=drivermanager.getconnection(connstr)//connect to DBMS
Statement stmt=conn.createStatement();
rs=stmt.executQuery(sql);
System.out.println(" id name province health");
while(rs.next()){
System.out.print(" "+rs.getInt("ID"));
System.out.print(" "+rs.getString("Name"));
S
S//above
}
rs.close;
stmt.close;
}
catch(Exception e){
e.getMessage();
e.printStackTrace();
}
}
}
DataBase Config ,rich man contain! small big/small not spilt!