图书管理系统
效果图:
实现对图书的增删查改
建立数据库表:
添加数据:
连接mysql需要导入相应的包:
连接数据库的代码:
Class.forName("com.mysql.cj.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/数据库名?
String username="root";
String password="123456";
Connection con=DriverManager.getConnection(url,username,password);
Statement st=con.createStatement();
String sql="select * from tb_book";
ResultSet rs=st.executeQuery(sql);
通过修改SQL语句使用servlet实现对数据的删改查询和页面跳转
页面美化(立体动态导航栏):
.box{
width: 600px;
height: 50px;
background:#F1F1EF;
margin: 50px 0 500px 0;
border-radius:10px;
box-shadow: 0 5px 2px #D8D9D1;<%--阴影 --%>
}
.box ul{
height: 100%;
padding: 0 5%;
list-style: none;<%-- --%>
color: #fff;
display: flex;<%--行内容器模式 --%>
justify-content: space-around;<%--每个项目两侧间隔相等 --%>
font:bold 16px/50px Arial;
}
.box ul li{
height: 100%;
width: 100px;
display: flex;
align-items: center;
justify-content: center;
text-shadow:2px 2px 4px rgba(0,0,0,.5);<%--字体阴影 --%>
background: linear-gradient(#D8D9D1) no-repeat right/1px 15px;
}
.box ul li a{
text-decoration: none;
color: #fff;
}
.box ul li a:hover{
transform: rotate(10deg);<%--旋转角度 度数单位deg --%>
}
转自:https://blog.csdn.net/coolpail/article/details/82501442