一:数据库 1. 正确install mysql 2. mysql -h localhost -u root -p 3. create database shujuku; 4. grant all privileges on shujuku.* to test@localhost identified by "12345"; 5. use shujuku; 6. create table biao (id int(8) primary key, name varchar (32)); 7. insert into biao value(1,'vingo'); 8. download mysql jdbc driver and copy the 'mysql-connector-java-5.1.7-bin.jar' to tomcat lib directory. 二: JSP part ") ; while(rs.next()) { out.print(rs.getString(1) + " ") ; out.print("|"); out.print(rs.getString(2)); out.print("
"); } out.print("
"); out.print("database query successfully ... congratulation ... "); rs.close(); statement.close(); connection.close(); %> 三:Don't forget to restart tomcat, it should reload all library.
jsp连接mysql数据库 例子_JSP 连接 MySQL 数据库的例子
最新推荐文章于 2022-06-01 19:32:55 发布