当前位置:Gxlcms > 数据库问题 > JDBC连接数据库五步

JDBC连接数据库五步

时间:2021-07-01 10:21:17 帮助过:2人阅读

1、加载驱动程序

  Class.forName(DriverClass);

2、连接数据库

  Connection connect = DriverManager.getConnection(DataBase URL);

3、创建语句

  Statement statement = connect.createStatement();

4、执行语句

  ResultSet rs = statement.executeQuery(SQL语句);

5、处理ResultSet

JDBC连接数据库五步

标签:

人气教程排行