📄 sqlconstants.java
字号:
/**
* BMS Online(Book Manager System Online,在线图书管理系统)
* 主要的SQL语句
*/
package fuguo.yy1.util;
/**
* @author cankongyun
*
*/
public class SQLConstants {
/**
* 与用户操作有关的SQL语句
*/
public static String SELECT_CHECK_USER="select id from user where userName=? and passWord=?";
//用户登录验证
public static String SELECT_CHECK_USERNAME="select userName from user where userName=?";
//检测用户名是否存在
public static String INSERT_USER="insert into user(userName,passWord,gender,age) values(?,?,?,?)";
//用户注册
public static String SELECT_USERS="select * from user order by id desc";
//显示所有用户
public static String SELECT_USER_ID="select * from user where id=?";
//根据用户ID查询用户信息
public static String UPDATE_USER = "update user set gender=?,age=? where id=?";
//修改用户信息
public static String DELETE_USER="delete from user where id=?";
//删除用户
/**
* 与图书类别有关的SQL语句
*/
public static String SELECT_BOOKCATEGORYS="select * from bookCategory order by bookCategoryId desc";
//显示所有图书类别
public static String SELECT_CHECK_CATEGORYNAME="select bookCategoryId from bookCategory where categoryName=?";
//检测某类别是否存在
public static String SELECT_BOOKCATEGORY_ID="select * from bookCategory where bookCategoryId=?";
//根据图书类别Id查询类别信息
public static String UPDATE_BOOKCATEGORY="update bookCategory set categoryName=? where bookCategoryId=?";
//修改图书类别
public static String DELETE_BOOKCATEGORY="delete from bookCategory where bookCategoryId=?";
//删除图书类别
/**
*与图书有关的SQL语句
*/
public static String SELECT_BOOKS="select * from book_baseInfo order by bookId desc";
//显示所有图书信息
public static String SELECT_CHECK_BOOKNAME="select bookName from book_baseInfo where bookName=?";
//检测图书名是否存在
public static String INSERT_BOOK="insert into book_baseInfo(bookName,bookCategoryId,price,amount) values(?,?,?,?)";
//添加图书信息
public static String SELECT_BOOK_ID="select * from book_baseInfo where bookId=?";
//根据图书Id查询图书信息
public static String SELECT_BOOK="select * from book_baseInfo as b,bookCategory as bc where b.bookName like '%";
//关键字查询图书信息
public static String UPDATE_BOOK="update book_baseInfo set bookName=?,bookCategoryId=?,price=?,amount=? where bookId=?";
//修改图书信息
public static String DELETE_BOOK="delete from book_baseInfo where bookId=?";
//删除图书信息
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -