?? mysql.txt
字號(hào):
1. mysql中查詢最后一條記錄:select * from employeeinfotable order by ID desc limit 1
2. java中把String轉(zhuǎn)換為Date型:
String date="2006-11-23"
SimpleDateFormat df =new SimpleDateFormat("yyyy-MM-dd");
java.util.Date cDate = df.parse(date);
java.sql.Date dd = new java.sql.Date(cDate.getTime());
System.out.println("轉(zhuǎn)換后日期="+dd);
3.java中把字符串?dāng)?shù)字轉(zhuǎn)換為整型:
string employeeid="123456";
int employeeid=Integer.valueOf(rs.getString("EmployeeId"));
4.使用RequestDispatcher重導(dǎo)頁(yè)面導(dǎo)index.jsp,index.jsp失去css樣式,使用<%=request.getContextPath()%>得到項(xiàng)目的根目錄!
5.java中string 類型和Date類型間的
//STRING到日期
public static java.sql.Date stringToDate(String dateStr)
{
return java.sql.Date.valueOf(dateStr);
}
//日期到STRING
public static String dateToString(java.sql.Date datee)
{
return datee.toString();
}
6.先導(dǎo)入兩個(gè)類java.util.*,java.text.*
加簡(jiǎn)單的一句話:String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
date就是你得到的時(shí)間,顯示格式可以根據(jù)("yyyy-MM-dd HH:mm:ss")的格式隨意調(diào)整,如果你想取到一些更具體的一些日期行數(shù)據(jù)
可以查看API的Calendar類。
7.清除頁(yè)面緩存:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv='Expires' content='-10'>
<meta http-equiv='Pragma' content='No-cache'>
<meta http-equiv='Cache-Control', 'private'>
8.
MySql中進(jìn)行數(shù)據(jù)庫(kù)備份和恢復(fù)
命令都在DOS控制臺(tái)下,而不在MySql控制臺(tái)下
在C:\mysql5\bin>而不是mysql>.
備份一個(gè)數(shù)據(jù)庫(kù)c:\mysql5\bin>mysqldump -u root -proot logistic>d:\logistic.sql
還原數(shù)據(jù)庫(kù):c:\mysql\bin>mysql -u root -proot cklogistic<d:\logistic.sql
備份所有數(shù)據(jù)庫(kù):c:\mysql5\bin>mysqldump -u root -proot --all-database>d:\backup.sql
備份一個(gè)數(shù)據(jù)庫(kù)中的個(gè)別表:(備份mysql數(shù)據(jù)庫(kù)中的 user 和host數(shù)據(jù)表)
c:\mysql5\bin>mysqldump -u root -proot mysql user host>d:\backup.sql
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -