标签:String 管理 author jsp time type public 图书 name
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; } }
标签:String,管理,author,jsp,time,type,public,图书,name 来源: https://www.cnblogs.com/lutiantian/p/14770944.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。