javaÖÐÁ¬½Ó¸÷Êý¾Ý¿âµÄÇý¶¯ÀàºÍÁ¬½Ó·½Ê½
1.JAVAÁ¬½ÓACCESSÊý¾Ý¿â
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ="+application.getRealPath("/Data/ReportDemo.mdb");
Connection conn = DriverManager.getConnection(url,"","");
ÔÚÉÏÃæµÄÁ¬½Ó·½·¨ÖУ¬ËùÉæ¼°µ½µÄ²ÎÊýº¬ÒåÈçÏÂËùʾ£º
* sun.jdbc.odbc.JdbcOdbcDriver:Çý¶¯³ÌÐòÀàµÄÃû³Æ¡£
* /Data/ReportDemo.mdb:Êý¾Ý¿âÎļþ
* ÆäÖеÄÓû§ÃûºÍÃÜÂë¾ùΪ¿Õ
2.JAVAÁ¬½ÓMySQLÊý¾Ý¿â
Class.forName("org.gjt.mm.mysql.Driver");
String url="jdbc:mysql://localhost/myDB?user=soft&password=soft1234&userUnicode=true&characterEncoding=8859_1"
Connection conn = DriverManager.getConnection(url);
ÔÚÉÏÃæµÄÁ¬½Ó·½·¨ÖУ¬ËùÉæ¼°µ½µÄ²ÎÊýº¬ÒåÈçÏÂËùʾ£º
* org.gjt.mm.mysql.Driver£ºÇý¶¯³ÌÐòÀàµÄÃû³Æ
* localhost£ºÊý¾Ý¿âµÄµØÖ·
* myDB£ºÊý¾Ý¿âµÄÃû³Æ
* soft£º·ÃÎÊÊý¾Ý¿âµÄÓû§Ãû
* soft1234£º·ÃÎÊÊý¾Ý¿âµÄÃÜÂë
* 8859_1£ºÊ¹ÓõÄ×Ö·û¼¯¡£
3.JAVAÁ¬½ÓSQL Server 7.0/2000Êý¾Ý¿â
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb";
String user="sa";
String password="";
Connection conn = DriverManager.getConnection(url,user,password);
ÔÚÉÏÃæµÄÁ¬½Ó·½·¨ÖУ¬ËùÉæ¼°µ½µÄ²ÎÊýº¬ÒåÈçÏÂËùʾ£º
* com.microsoft.jdbc.sqlserver.SQLServerDriver£ºÇý¶¯³ÌÐòÀàµÄÃû³Æ
* localhost£ºÊý¾Ý¿âµÄµØÖ·
* 1433£ºÊý¾Ý¿â·þÎñµÄ¶Ë¿Ú
* myDB£ºÊý¾Ý¿âµÄÃû³Æ
* user£º·ÃÎÊÊý¾Ý¿âµÄÓû§Ãû
* password£º·ÃÎÊÊý¾Ý¿âµÄÃÜÂë
4.JAVAÁ¬½ÓOracle 8/8i/9iÊý¾Ý¿â(thinģʽ)
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbc:oracle:thin:@192.168.0.1:1521:orcl";
String user="test";
String password="test";
Connection conn = DriverManager.getConnection(url,user,password);
ÔÚÉÏÃæµÄÁ¬½Ó·½·¨ÖУ¬ËùÉæ¼°µ½µÄ²ÎÊýº¬ÒåÈçÏÂËùʾ£º
* oracle.jdbc.driver.OracleDriver£ºÇý¶¯³ÌÐòÀàµÄÃû³Æ
* jdbc:oracle:thin£ºÊ¹ÓÃthinģʽÁ¬½Ó
* 192.168.0.1£ºÊý¾Ý¿âµÄIPµØÖ·
* 1521£ºÊý¾Ý¿â·þÎñµÄ¶Ë¿Ú£¬ÕâÊÇOracleµÄĬÈÏÖµ
* orcl£ºÊý¾Ý¿âµÄSID
* user£º·ÃÎÊÊý¾Ý¿âµÄÓû§Ãû
* password
Ïà¹ØÎĵµ£º
/*ÄÚ²¿ÀàʹÓÃʾÀý*/
package demo;
class Outer{
int outer_i=100;
static int outer_j=200;
final int outer_k=300;
void test(){
Inner in = new Inner();
in.display();
}
static class Inner{
void display(){
  ......
/*¶à̬ʾÀý*/
package demo;
class AA {
public void f(){
System.out.println("f in AA");
}
}
class BB extends AA{
public void f(){
System.out.println("f in BB");
}
}
public class Test_Dt {
public static void main(String[] args) ......
Flex Java ÉÏ´« ÏÂÔØ ×é¼þ ÊÕ²Ø
ÊÂÇ°×¼±¸¾ÍÊǵ½http://commons.apache.orgÏÂÔØcommon-fileupload-1.1.1.jarÒÔ¼°common-io-1.2.jarÁ½¸ö°ü¡£
ǰ̨Flex´úÂ룺
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*" creationComplet ......
/**
* ±£ÁôÁ½Î»Ð¡Êý
* @param d
* @return
*/
private static double remainTwoNumbers(double d){
java.math.BigDecimal f1 = new java.math.BigDecimal(d);//СÊýµãºó±£Áô2Î ......
Ò»¡¢´Ó¸ù±¾ÉÏÈÏʶjava.lang.StringÀàºÍString³Ø
Ê×ÏÈ£¬ÎÒ½¨ÒéÏÈ¿´¿´StringÀàµÄÔ´ÂëʵÏÖ£¬ÕâÊÇ´Ó±¾ÖÊÉÏÈÏʶStringÀàµÄ¸ù±¾³ö·¢µã¡£´ÓÖпÉÒÔ¿´µ½£º
1¡¢StringÀàÊÇfinalµÄ£¬²»¿É±»¼Ì³Ð¡£public final class String¡£
2¡¢StringÀàÊǵı¾ÖÊÊÇ×Ö·ûÊý×échar[], ²¢ÇÒÆäÖµ²»¿É¸Ä±ä¡£private final char value[];
È»ºó´ò¿ªStr ......