jsp图书管理
2021/5/15 10:55:13
本文主要是介绍jsp图书管理,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
package com.library.dao; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import com.sun.corba.se.pept.transport.Connection; import com.sun.corba.se.spi.orbutil.fsm.Guard.Result; public class BaseDao { //gain protected Connection getConnection() { Connection conn = null; try { Class.forName("com.mysql.jdbc.Driver"); conn = (Connection) DriverManager.getConnection("jdbc:mysq;://localhost:3306/mysql","root","1234"); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return conn; } //release @SuppressWarnings("unused") private void closeAll(Connection con,PreparedStatement ps,ResultSet rs) { // TODO Auto-generated method stub try { if (rs != null) { rs.close(); } if (ps != null) { ps.close(); } if (con != null) { con.close(); } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } } }
insert into book (b_name,b_author,b_time,b_type) values ('CSS','Alice',2020-02-04,0); insert into book (b_name,b_author,b_time,b_type) values ('JSP','Alice',2020-02-04,0); insert into book (b_name,b_author,b_time,b_type) values ('JavaScript','Alice',2020-02-04,0); insert into book (b_name,b_author,b_time,b_type) values ('C#','Jack',2020-02-04,0);
public class BookManage { private int id; private String name; private String author; private String time; private int type; public BookManage() { } public BookManage(String name,String author,String time,int type) { this.name = name; this.author = author; this.time = time ; this.type = type; } public BookManage(int id,String name,String author,String time,int type) { this.id = id; this.name = name; this.author = author; this.time = time ; this.type = type; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public int getType() { return type; } public void setType(int type) { this.type = type; } }
这篇关于jsp图书管理的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-09vue3开发前端表单缓存自定义指令,移动端h5必备插件
- 2024-05-09React Hooks在class组件中的使用方式
- 2024-03-30[OIDC in Action] 2. 基于OIDC(OpenID Connect)的SSO(纯JS客户端)
- 2024-03-29terraform jsonencode
- 2024-03-13vuex-persist
- 2024-03-11icons for vue
- 2024-03-07breadcrumbs react js
- 2024-03-06react login page example
- 2024-03-06react router uselocation
- 2024-03-04postgres jsonb_set