java Ï̳߳Ø
Ðí¶àʱºòÎÒÃÇÐèÒªÓõ½Ïß³Ì ±ÈÈçÏ£ÍûÒ»¸ö¸½¼ÓµÄ¹¦ÄÜ ²»ÒªÓ°ÏìÕû¸öÁ÷³ÌµÄ¹¦ÄÜ£¬±ÈÈçij¸öÁ÷³ÌÐèÒª¼ÓÈëÈÕÖ¾£¬µ«ÊDz»Ï£Íû¼Ç¼ÈÕÖ¾µÄ¹¦ÄÜÓ°ÏìÕû¸öÁ÷³ÌµÄÐÔÄÜ£¬²»ÄÜÒòΪ¼Ç¼ÈÕÖ¾°ÑÕû¸öÁ÷³Ì¸ø¿¨×¡ÁË¡£ÔÚÕâ¸öÖÖÇé¿öÏ£¬ÎÒÃÇÐèҪʹÓÃÏ̡߳£ÈüǼÈÕÖ¾ÔÚµ¥¶ÀÒ»¸öÏß³ÌÀïÃæÅÜ£¬¾Í²»»áÓ°Ï춼ÆäËûÁ÷³ÌÁË¡£
ÔںܶàʱºòÎÒÃÇ»¹ÊÇʹÓÃÏ̳߳صģº ÔÚÏÂÃæµÄÀý×ÓÊÇ Ôڹ涨µÄʱ¼äÄÚÅжÏÊý¾Ý¿âÊÇ·ñÁ¬½Ó³É¹¦¡£
Ò»¸öÏß³ÌÓÃÓÚÁ¬½ÓmysqlµÄÀà £º
package db;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Properties;
public class ConnMysql implements Runnable {
private static String connS=null;
public Connection getMysqlConn() {
String mysqlDBDriver = "com.mysql.jdbc.Driver";
String msqlUrl = "jdbc:mysql://203.175.156.78:3306/client";
Connection mysqlConn = null;
try {
DriverManager.registerDriver((Driver) Class.forName(mysqlDBDriver).newInstance());
Properties oDbProps1 = new Properties();
oDbProps1.put("user", "root");
oDbProps1.put("password", "root");
mysqlConn = DriverManager.getConnection(msqlUrl, oDbProps1);
} catch (Exception e) {
e.printStackTrace();
}
return mysqlConn;
}
public void run() {
connS=getMysqlConn().toString();
}
public static String getConnS() {
return connS;
}
}
ÁíÒ»¸öÏß³ÌÓÃÓÚ¼ÇʱµÄÒ»¸öÀà £º
package db;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class GetTime implements Runnable {
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
private String nowTime = sdf.format(new Date());
private static long disT = 0;
private static int num = 0;
public int getShijianchai() {
int between = 0;
try {
Date begin = sdf.parse(nowTime);
Date end = sdf.parse(this.getLastTime());
between = (int) ((end.getTime() - begin.getTime()) / 1000);//
Ïà¹ØÎĵµ£º
keytoolÉú³ÉÖ¤Êé
ÑéÖ¤ÊÇ·ñÒÑ´´½¨¹ýͬÃûµÄÖ¤Êé
keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
ɾ³ýÒÑ´´½¨µÄÖ¤Êé
keytool -delete -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
´´½¨Ö¤Êé
1.·þÎñ ......
ÎÒÃÇÔÚjspÒ³ÃæÉϵÄjs½Å±¾ÖпÉÒÔµ÷ÑÐjava´úÂ룬±ÈÈ磬ÎÒÃÇÐèÒªÔÙjsÖÐÓÃalertº¯ÊýÏÔʾ·þÎñÆ÷¶Ë·¢Ë͹ýÀ´µÄij¸ö×Ö·û´®ÄÇôÎÒÃÇ¿ÉÒÔÕâÑù×ö
tomcat주
ÔÚ·þÎñÆ÷¶ËÎÒÃÇÓÐrequest.setAttribute("name","abc");
ÄÇôÎÒÒªÔÚÒ³ÃæÉÏÓÃalertÏÔʾµÄ»°£¬ÓÐÁ½ÖÖ·½Ê½£º
1¡¢Ê¹ÓÃEL±í´ïʽ
ÔÚEl±í´ïʽµÄÍâÃæÓÃÒýºÅ¼´¿É£º
<scri ......
¹Ø¼ü×Ö: javaÖÐjxlµ¼³öÊý¾Ýµ½excelµÄÀý×Ó
ÒªÍùxlsÎļþÀïÃæдÈëÊý¾ÝµÄʱºòÐèҪעÒâµÄÊǵÚһҪн¨Ò»¸öxlsÎļþ
OutputStream os=new FileOutputStream("c:\\excel2.xls" );
ÔÙ½¨ÍêÕâ¸öÎļþµÄʱºòÔÙ½¨Á¢¹¤×÷Îļþ
jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(new File(os));
Èç¹ûÕâ¸öÎļþÒѾ´æÔÚ,ÄÇà ......
¶ÔÏó³Ö¾Ã»¯£¬Ò²¾ÍÊÇ¿ÉÒÔ°ÑÕâ¸ö¶ÔÏóÓÀÔ¶µÄ±£´æÆðÀ´£¬ÕâÀïµÄ±£´æ²»½öÊǶÔÏó±¾Éí£¬»¹°üÀ¨ËûµÄÊôÐÔºÍËùÒÀÀµµÄÆäËûÀࡣͨ³££¬¶ÔÏó¿ÉÒԳ־û¯µ½Îļþ»òÕßÊÇÊý¾Ý¿âÖС£ÎÒÕâÀïÖ»½éÉÜÈçºÎ½«¶ÔÏó´æ´¢µ½Êý¾Ý¿âÖС£Ç¡ÇÉOracleÊý¾Ý¿âΪÎÒÃÇÌṩÁËÕâÑùµÄ·½±ã¡£
ÔÚOracleÖУ¬ÓÐÒ»ÖÖblogµÄ×Ö¶ÎÀàÐÍ£¬ËüÊÇÓÃÀ´´æ´¢´óÁ¿µÄ¶ ......
ÕâƪÎÄÕ²»ÊǶÔprivate£¬public£¬protected½øÐÐ˵Ã÷£¬Ö»ÒªÑ§¹ýÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼Æ£¬¶ÔÒÔÉÏÈý¸ö¹Ø¼üÔÙÊìϤ²»¹ýÁË¡£ÕâÀïҪ˵µÄÊÇÁíÍâÁ½¸ö¹Ø¼ü×Ö---staticºÍfinal¡£
1. static¹Ø¼ü×Ö
ÔÚÎÒÃÇ´´½¨Ò»¸öÀàµÄʵÀýʱ£¨¶ÔÏ󣩣¬Í¨³£Ê¹ÓÃnew·½·¨£¬ÕâÑùÕâ¸öÀàµÄÊý¾Ý¿Õ¼ä²Å»á±»´´½¨£¬Æä·½·¨²ÅÄܱ»µ÷Óá£
& ......