ʹÓÃJavaʵÏÖ¶ÔMySqlÊý¾Ý¿âµÄµ¼ÈëÓëµ¼³ö
package com.project.ajaxs;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.Calendar;
import java.util.Date;
public class BakMysql {
//mainµÄ·½·¨£¬Ö÷ÒªÊÇÎÒÓÃÓÚ²âÊԵģ¬ÊÇÏë×ÅÈ¡µÃCLASSµÄ·¾¶£¬È»ºó±¸·ÝµÄÎļþдÔÚ·þÎñÆ÷µÄÀà·¾¶ÏÂ
public static void main(String[] args) {
BakMysql bk = new BakMysql();
bk.backup();
// bk.load();
}
//backup·½·¨ÊDZ¸·ÝÊý¾Ý¿âµ½·þÎñÆ÷µØÖ·
public void backup() {
Calendar now = Calendar.getInstance();
String name = now.getTime()+""+(now.getTime().getMonth()+1)+""+now.getTime().getDate();
String filename = name.substring(24)+" "+name.substring(11,13)+""+name.substring(14,16)+""+name.substring(17,19);
try {
String filePath ="e:/project"+filename+".sql";
Runtime rt = Runtime.getRuntime();
// µ÷Óà mysql µÄ cmd:
Process child = rt.exec("C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump.exe -uroot -p8095longchun project");// ÉèÖõ¼³ö±àÂëΪutf8¡£ÕâÀï±ØÐëÊÇutf8
//×¢ÒâÕâÒ»¾ä£¬ÊÇÖ¸ÔËÐÐmysqldumpÃüÁºóÃæ¸úµÄÊǵǼÃûºÍµÇ¼µÄÃÜÂ룬½ÓןóÃæµÄÊÇÖ¸±¸·ÝµÄÊý¾Ý¿âµÄÃû×Ö£¬µ½´Ë½áÊø£¬ÒÔ´ËÉú³ÉÒ»¸öÖ´ÐеĽø³Ì£¬È¡µÃ´Ë½ø³ÌµÄÊä³öÁ÷µ½ÎÒÃÇÒª±¸·ÝµÄÎļþ
// °Ñ½ø³ÌÖ´ÐÐÖеĿØÖÆ̨Êä³öÐÅϢдÈë.sq
Ïà¹ØÎĵµ£º
ÊÇ¿½±´µÄ±ðÈ˵ģ¬ÒÔ±¸Ñ§Ï°
package com.unmi.db;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* ¶ÁÈ¡ SQL ½Å±¾²¢Ö´ÐÐ
* @author Unmi
*/
pub ......
<?php
/*
*PHP¹ÜÀíMYSQLµÄÊý¾Ý¿âÀà
ʹÓ÷½·¨£º$dbConn = new DbConn([$Êý¾Ý¿âÃû(¿ÉÑ¡)]);
ÔÊÐí·µ»ØµÄ·½·¨£º
Execute($sql) //Ö´ÐÐSQLÓï¾ä£¬Ã»Óзµ»ØÖµ;
getRs($sql) //·µ»Ø²éѯÓï¾äµÄ¼Ç¼£¬Ò»Ìõ;
getRsArray($sql) //·µ» ......
±È½ÏPHPºÍJSPÕâÁ½¸öWeb¿ª·¢¼¼Êõ,ÔÚÄ¿Ç°µÄÇé¿öÊÇÆäʵÊDZȽÏPHPºÍJavaµÄWeb¿ª·¢.ÒÔÏÂÊÇÎҾͼ¸¸öÖ÷Òª·½Ãæ½øÐеıȽÏ:
Ò». ÓïÑԱȽÏ
PHPÊǽâÊÍÖ´ÐеķþÎñÆ÷½Å±¾ÓïÑÔ,Ê×ÏÈphpÓмòµ¥ÈÝÒ×ÉÏÊÖµÄÌصã.Óï·¨ºÍcÓïÑԱȽÏÏó,ËùÒÔѧ¹ýcÓïÑԵij ......
ÔËÐÐ×Ô¼ºÅäÖõÄwebÓ¦Óã¬ÍùÍùÖ»ÄÜ¿´¼ûweblogic±àÒëÖ®ºóµÄclassÎļþ¡£¶ø¿´²»¼û±àÒëÇ°µÄjavaµÄÎļþ¡£ÎªÁ˵÷ÊÔ·½±ã£¬ÎÒÃÇÓÐʱºòÊÇÏë¿´±àÒëÇ°µÄjavaÎļþ¡£
ÔÚweblogic.xmlÖмÓÈë
<jsp-descriptor>
<jsp-param>
<param-name>keepgenerated</param-name>
<param-value>true</par ......
package thread.lock;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* @file_name ReadAndWriteLockDemo.java
* @description ¶ÁÐ ......