java¼ÓÃÜÓë½âÃÜ£¨Ò»£©
jdk°²È«Ç¿¶ÈÉèÖãº
http://java.sun.com/javase/downloads/index.jspÖеÄOther DownloadsÏÂÔØ
½âѹzip,
ÓÃÆäÖеÄÁ½¸öjar°ü¸²¸Çjdk6ÏÂ\%JDK_HOME%\jre\lib\securityĿ¼ÏµÄjar°ü
jreĿ¼ÏÂÒ²×÷ÏàͬÅäÖÃ
È»ºóͨ¹ý´úÂë¶Î
try {
KeyGenerator kg = KeyGenerator.getInstance("AES");
kg.init(256);
SecretKey secretKey = kg.generateKey();
byte[] key = secretKey.getEncoded();
System.out.println("ok");
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
¶Ôµ÷ÕûºóµÄϵͳȨÏÞ½øÐÐÑéÖ¤,Ö´ÐÐ˳Àû,±íʾÉúЧ,Èç¹û²»½øÐе÷Õû,ÓÉÓÚ³ö¿ÚÏÞÖÆ,ÃÜÔ¿²»Ö§³Ö256λ.
MD4,IDEAµÈ¼ÓÃÜËã·¨,java6²»Ö§³Ö,¿ÉÒÔͨ¹ýÔÚJRE»·¾³ÖÐÅäÖÿªÔ´×é¼þ°üBounce Castle,¼ÓÈë¶ÔÓ¦µÄ
ÌṩÕß,»ñµÃÏàÓ¦µÄËã·¨Ö§³Ö.
´Óhttp://www.bouncycastle.org/latest_releases.html
ÏÂÔØ bcprov-jdk16-145.jar ,bcprov-ext-jdk16-145.jar
À©³äËã·¨Ö§³ÖµÄÁ½ÖÖ·½Ê½
1ÅäÖ÷½Ê½:
ÐÞ¸ÄÅäÖÃÎļþ,\%JDK_HOME%\jre\lib\security\java.securityÖмÓÈë
security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider
È»ºó°Ñbcprov-ext-jdk16-145.jar·ÅÈë\%JDK_HOME%\jre\lib\extĿ¼ÏÂ
jreĿ¼ÏÂÒ²×÷ÏàͬÅäÖÃ
2µ÷Ó÷½Ê½:
°Ñbcprov-jdk16-145.jarµ¼È빤³Ì,½Ó×ÅÔÚ³ÌÐòÖÐÒªµ¼ÈëÁ½¸öÀà
java.security.Security
org.bouncycastle.jce.provider.BouncyCastleProvider
½Ó×ÅÔÚ³õʼ»¯¹¤³§,ÃÜÔ¿Éú³ÉÆ÷µÈÒýÇæÀàʱ,²ÉÓÃÈçÏ·½Ê½
Security.addProvider(new BouncyCastleProvider())
»òÕßÔÚ³õʼ»¯¹¤³§,ÃÜÔ¿Éú³ÉÆ÷µÈÒýÇæÀàʱ,²ÉÓÃÈçÏ·½Ê½
MessageDigest md = MessageDigest.getInstance("MD4","BC");
Ïà¹ØÎĵµ£º
phpºÍjavaͨÓÃsqlÓï¾ä·¨
SELECT max(id) from table
¸Ã·½·¨ÔÚ¶àÏ̵߳ÈÇé¿öÏ¿ÉÄÜ»áÔì³É²»ÕýÈ·¡£
javaÈýÖÖ·½·¨
1¡¢¸ù¾ÝpsµÄgetGeneratedKeys
PreparedStatement ps = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS); //ºìÉ«Êǹؼü
ps.executeUpdate(); //Ö´Ðкó
ResultSet rs = ps.getGeneratedKeys ......
×òÌì¿´µ½ÕâÑùһƪÌû×Ó£¬ÌÖÂÛÀà¼ÓÔØ˳ÐòµÄ£¬Ò²¿ÉÒÔ˵Êdzõʼ»¯Ë³ÐòµÄ£¬½ñÌìÔçÉÏÕÒ²»µ½ÁË£¬±¾À´Ïë»Ø¸´µÄ£¬ÏÖÔÚ×Ô¼ºÐ´²©¿Í»Ø¸´ÁË£¬ºÇºÇ
public class Singleton {
private static Singleton obj = new Singleton();
public static int counter1 ;
public static int counter2 = 0;& ......
´Ójdk1.5¿ªÊ¼£¬JavaÖпªÊ¼Ö§³Ö·¶ÐÍÁË¡£·¶ÐÍÊÇÒ»¸öºÜÓÐÓõıà³Ì¹¤¾ß£¬¸øÎÒÃÇ´øÀ´Á˼«´óµÄÁé»îÐÔ¡£ÔÚ¿´ÁË¡¶javaºËÐıà³Ì¡·Ö®ºó£¬ÎÒСÓÐÊÕ»ñ£¬Ð´³öÀ´Óë´ó¼Ò·ÖÏí¡£
Ëùν·¶ÐÍ£¬Îҵĸоõ¾ÍÊÇ£¬²»Óÿ¼ÂǶÔÏóµÄ¾ßÌåÀàÐÍ£¬¾Í¿ÉÒÔ¶Ô¶ÔÏó½øÐÐÒ»¶¨µÄ²Ù×÷£¬¶ÔÈκζÔÏó¶¼Ä ......
ÔÚjava.math°üÖÐÓиöBigDecimalÀ࣬ͨ¹ýÕâ¸öÀà¿ÉÒÔ½øÐо«È·¼ÆËã. ÎÒÃÇÖªµÀBigDecimalÓиösetScale(int ¾«¶È,int ÉáÈëģʽ)·½·¨£¬ËæÖ®¶øÀ´ÎÊÌâ³öÏÖÁË£¬µ±ÔËÐÐÈçÏ´úÂëʱ£º
/**
* @author troy(J2EE)
* @version 1.0
*/
import java.math.*;
public class Test{
& ......