JAVAÊý¾Ý¿âÁ¬½Ó´óÈ«
1¡¢Oracle8/8i/9iÊý¾Ý¿â£¨thinģʽ£©
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orclΪÊý¾Ý¿âµÄSID
String user="test";
String password="test";
Connection conn= DriverManager.getConnection(url,user,password);
2¡¢DB2Êý¾Ý¿â
Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();
String url="jdbc:db2://localhost:5000/sample"; //sampleΪÄãµÄÊý¾Ý¿âÃû
String user="admin";
String password="";
Connection conn= DriverManager.getConnection(url,user,password);
3¡¢SQL Server7.0/2000Êý¾Ý¿â
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb";
//mydbΪÊý¾Ý¿â
String user="sa";
String password="";
Connection conn= DriverManager.getConnection(url,user,password);
4¡¢SybaseÊý¾Ý¿â
Class.forName("com.sybase.jdbc.SybDriver").newInstance();
String url =" jdbc:sybase:Tds:localhost:5007/myDB";//myDBΪÄãµÄÊý¾Ý¿âÃû
Properties sysProps = System.getProperties();
SysProps.put("user","userid");
SysProps.put("password","user_password");
Connection conn= DriverManager.getConnection(url, SysProps);
5¡¢InformixÊý¾Ý¿â
Class.forName("com.informix.jdbc.IfxDriver").newInstance();
String url = "jdbc:informix-sqli://123.45.67.89:1533/myDB:INFORMIXSERVER=myserver;
user=testuser;password=testpassword"; //myDBΪÊý¾Ý¿âÃû
Connection conn= DriverManager.getConnection(url);
6¡¢MySQLÊý¾Ý¿â
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
//»òÕßClass.forName("com.mysql.jdbc.Driver");
String url ="jdbc:mysql://localhost/myDB?
user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1"
//myDBΪÊý¾Ý¿âÃû
Connection conn= DriverManager.getConnection(url);
7¡¢PostgreSQLÊý¾Ý¿â
Class.forName("org.postgresql.Driver").newInstance();
String url ="jdbc:postgresql://localhost/myDB" //myDBΪÊý¾Ý¿âÃû
String user="myuser";
String password="
Ïà¹ØÎĵµ£º
±¾ÎÄÃæÏòÓÚÄÇЩÈí¼þ¼Ü¹¹Ê¦£¬Éè¼ÆʦºÍ¿ª·¢ÈËÔ±£¬ËûÃÇÏëʹÓà IBM® Rational® Software Architect ´Ó Java™ Ô´´úÂëÀ´ÄæÏò¹¤³ÌÉú³É UML ÀàºÍÐòÁÐͼ¡£ ÄæÏò¹¤³Ì¾³£±»ÓÃÀ´´ÓÒÑÓеÄÔ´´úÂëÖÐÒÔÒ»ÖÖ³éÏóÄ£ÐÍ UML ¸ñʽÀ´»ñµÃ¶ªÊ§µÄÉè¼ÆÎĵµ£¬Æä¿ÉÒÔÓÃÀ´Ñо¿Ò»¸öϵͳµÄ¾²Ì¬½á¹¹ºÍ¶¯Ì¬ÐÐΪ£¬²¢ÓÃÓÚÀ©Õ¹ÐµÄÌØÐÔµ½²úÆ·¡£ ......
½«ÏÂÔغóµÄÎļþ½â°ü£¬µÃµ½jxl.jar£¬·ÅÈëclasspath£¬°²×°¾ÍÍê³ÉÁË¡£
»ù±¾²Ù×÷
Ò»¡¢´´½¨Îļþ
ÄâÉú³ÉÒ»¸öÃûΪ“²âÊÔÊý¾Ý.xls”µÄExcelÎļþ£¬ÆäÖеÚÒ»¸ö¹¤×÷±í±»ÃüÃûΪ“µÚÒ»Ò³”£¬´óÖÂЧ¹ûÈçÏ£º
´úÂ루CreateXLS.java£©£º
//Éú³ÉExcelµÄÀà
import java.io.*;
import jxl.*;
import jxl.write. ......
ÈýÖÜÇ°£¬¾ÍÓëͬѧԼ¶¨ºÃÁË£¬»¨ÈýÖÜʱ¼äд¸öÌ°³ÔÉߣ¬¾ÍÓÃ×Ô¼ºÏÖÔÚËùѧµÄJava£¬ÎÒÏë¿ÉÒÔ°¡¡£Ñ§Ð£Àï½Ì²»³öʲô¶«Î÷£¬ÄǾÍ×Ô¼º¸ã°É£¡ÓÚÊÇÎÒÃÇÐÅÊĵ©µ©¿ªÊ¼Á˼¸Ìì¡£²»ÁÏÎåÒ»Ò»À´£¬°ÑËùÓеĶ¼ÀÏÂÁË¡£×îºóÒ»ÖÜÁË£¬Ã»°ì·¨£¬Í¨Ïü°É£¡ÓÚÊÇÁ¬Ðø¼¸Ìì¿à¸É£¬ÖÕÓÚд³öÀ´ÁË.ËäÈ»Óеã´Ö²Ú£¬ÒòΪѧУ»¹Ã»¿ªÊ¼½ÌGUIº ......
³£³£Óöµ½Êý×éÅÅÐòµÄÎÊÌâ.±ÈÈçÎÒÓÐÒ»¸öPersonÀà,ËüµÄʵÀý¶ÔÏó´æ´¢ÔÚArrayListÊý×éÖÐ,ÏÖÔÚÒª°ÑArrayListÊý×éÖеÄPerson¶ÔÏó°´ÕÕÄêÁäÅÅÐò.
ÆäʵÕâÖÖÇé¿ö¾³£Óöµ½.
ÏÂÃæ¸ø³öÔ´´úÂë:
1:Person.JavaÎļþ:-------------------------------
public class Person{
String name;
int age;
public Person(String name,int age){ ......
ÏÈÌùÒ»¶Î
Java
»ù±¾½á¹¹
Java
½á¹¹°üÀ¨Ëĸö²»Í¬¶øÓÖÏà¹ØµÄ²¿·Ö£º
Java
ÓïÑÔ¡¢
class
Îļþ¸ñʽ¡¢Ó¦ÓóÌÐò½Ó
¿Ú¡¢ÐéÄâ»ú
ÆäÖУ¬ÐéÄâ»úµÄÖ÷ÒªÈÎÎñÊÇÔÚ³ÌÐòÔËÐÐÖÐÐèÒªµÄʱºòµ÷ÓÃ
class
Îļþ²¢Ö´ÐÐÆäÖеÄ×Ö½ÚÂë¡£Ò»¸ö
Java
Ó¦
ÓÃÓÐÁ½ÖÖ
class loader
£º
the system class loader
ºÍ
class loader objects
......