JavaÁ¬½ÓÊý¾Ý¿âµÄ·½·¨
JavaÁ¬½ÓÊý¾Ý¿âµÄ·½·¨
×¢£º×ªÓÚhttp://www.newasp.net/tech/java/15826.html
JAVAÁ¬½ÓÊý¾Ý¿âÖ÷ÒªÓÐÁ½ÖÖ·½Ê½:
Ò»ÊÇÓÃJDBC-ODBCÇÅÀ´Á¬½Ó
¶þÊÇÓÃÏà¹Ø³§ÉÌÌṩµÄÏàÓ¦Çý¶¯³ÌÐòÀ´Á¬½Ó
ÓÃJDBC-ODBCÇÅÀ´Á¬½Ó
JDBC-ODBCÇŽÓÆ÷ÊÇÓÃJdbcOdbc.ClassºÍÒ»¸öÓÃÓÚ·ÃÎÊODBCÇý¶¯³ÌÐòµÄ±¾µØ¿âʵÏֵġ£¶ÔÓÚWINDOWSƽ̨£¬¸Ã±¾µØ¿âÊÇÒ»¸ö¶¯Ì¬Á¬½Ó¿âDLL(JDBCODBC.DLL)¡£
ÓÉÓÚJDBCÔÚÉè¼ÆÉÏÓëODBCºÜ½Ó½ü¡£ÔÚÄÚ²¿£¬Õâ¸öÇý¶¯³ÌÐò°ÑJDBCµÄ·½·¨Ó³Éäµ½ODBCµ÷ÓÃÉÏ£¬ÕâÑù£¬JDBC¾Í¿ÉÒÔºÍÈκοÉÓõÄODBCÇý¶¯³ÌÐò½øÐн»»¥ÁË¡£ÕâÖÖÇŽÓÆ÷µÄÓŵãÊÇ£¬ËüʹJDBCÄ¿Ç°ÓÐÄÜÁ¦·ÃÎʼ¸ºõËùÓеÄÊý¾Ý¿â¡£Í¨Ðз½Ê½ÈçͼËùʾ£º
Ó¦ÓóÌÐò---JDBC API---JDBC-ODBC---ODBC API---ODBC²ã---Êý¾ÝÔ´
¾ßÌå²Ù×÷·½·¨Îª£º
Ê×ÏÈ´ò¿ª¿ØÖÆÃæ°åµÄ¹ÜÀí¹¤¾ß£¬´ò¿ªÊý¾ÝÔ´£¨ODBC£©£¬ÔÚÓû§DSNÀïÃæÌí¼ÓÊý¾ÝÔ´£¨¼´ÄãÒªÁ¬½ÓµÄÊý¾Ý¿âµÄÃû×Ö£©£¬ÔÚÕâÀï¼Ù¶¨Á¬½ÓSQL SERVER 2000µÄGoodsSupplyÊý¾Ý¿â¡£Ãû³ÆÌîдÄãÒªÁ¬½ÓµÄÊý¾Ý¿âµÄÃû³Æ£¨GoodsSupply£©£¬È»ºóÖð²½ÉèÖã¬Èç¹ûÑ¡ÓÃÁËʹÓÃSQL-SERVERÃÜÂëÈÏÖ¤µÄ»°£¬¾ÍÒªÊäÈëÏàÓ¦µÄÓû§Ãû¼°ÃÜÂëÁ¬½Óµ½Êý¾Ý¿â¡£Ò»Â·ÏÂÒ»²½ÉèÖÃÍê³É¡£
ÔÚJAVAÀïÃæ±àд³ÌÐò½øÐвâÊÔ£¬ÔÚÕâÀïÎҵijÌÐòÊÇÈÃÓû§ÊäÈëÈÎÒâµÄ±íÃûÓëÓëÁÐÃû£¬°Ñ¸ÃÁеÄËùÓÐÊý¾ÝÊä³ö¡£
Ô´´úÂëÈçÏ£º
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.sql.*;
public class ODBCBridge {
public static void main(String[] args) {
String url="jdbc:odbc:GoodsSupply";
Statement sm=null;
String command=null;
ResultSet rs=null;
String tableName=null;
String cName=null;
String result=null;
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
try {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //¼ÓÔØÇý¶¯
}catch(ClassNotFoundException e){
System.out.println("Can not load Jdbc-Odbc Bridge Driver");
System.err.print("ClassNotFoundException:");
System.err.println(e.getMessage());
}
Connection con=DriverManager.getConnection(url,"USER","PASSWORD"); //ʹÓÃSQL-SERVER2000ÈÏÖ¤
DatabaseMetaData dmd=con.getMetaData(); //DMDΪÁ¬½ÓµÄÏàÓ¦Çé¿ö
System.out.println("Á¬½ÓµÄÊý¾Ý¿â:"+dmd.getURL());
System.out.println("Çý¶¯³ÌÐò:"+dmd.getDriverName());
sm=con.createStatement();
System.out.print
Ïà¹ØÎĵµ£º
ÏßÐÔ±í£¬Á´±í£¬¹þÏ£±íÊdz£ÓõÄÊý¾Ý½á¹¹£¬ÔÚ½øÐÐJava¿ª·¢Ê±£¬JDKÒѾΪÎÒÃÇÌṩÁËһϵÁÐÏàÓ¦µÄÀàÀ´ÊµÏÖ»ù±¾µÄÊý¾Ý½á¹¹¡£ÕâЩÀà¾ùÔÚjava.util°üÖС£±¾ÎÄÊÔͼͨ¹ý¼òµ¥µÄÃèÊö£¬Ïò¶ÁÕß²ûÊö¸÷¸öÀàµÄ×÷ÓÃÒÔ¼°ÈçºÎÕýȷʹÓÃÕâЩÀà¡£
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
Map
©ÀHa ......
Java 7ÒѾÍê³ÉµÄ7´óй¦ÄÜ£º
1£©¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö£»
2£©×Ô¶¯×ÊÔ´¹ÜÀí£»
3£©¸Ä½øµÄͨÓÃʵÀý´´½¨ÀàÐÍÍƶϣ»
4£©Êý×Ö×ÖÃæÁ¿Ï»®ÏßÖ§³Ö£»
5£©switchÖÐʹÓÃstring£»
6£©¶þ½øÖÆ×ÖÃæÁ¿£»
7£©¼ò»¯¿É±ä²ÎÊý·½·¨µ÷Óá£
ÏÂÃæÎÒÃÇÀ´×Ðϸ¿´Ò»ÏÂÕâ7´óй¦ÄÜ£º
¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö
Java½«°üº¬¶Ô´´½¨¼¯ºÏÀàµÄµÚÒ»ÀàÓïÑÔÖ§³Ö¡ ......
inner classºÍouter classÖ®¼äµÄreflectionÓ¦Óá£
package com.gaoqian.reflection;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
class IncludeInn ......
ÔÚMerlin֮ǰ,±àдSocket³ÌÐòÊDZȽϷ±ËöµÄ¹¤×÷.ÒòΪÊäÈëÊä³ö¶¼±ØÐëͬ²½.ÕâÑù,¶ÔÓÚ¶à¿Í»§¶Ë¿Í»§/·þÎñÆ÷ģʽ,²»µÃ²»Ê¹ÓöàÏß³Ì.¼´ÎªÃ¿¸öÁ¬½ÓµÄ¿Í»§¶¼·ÖÅäÒ»¸öÏß³ÌÀ´´¦ÀíÊäÈëÊä³ö.Óɴ˶ø´øÀ´µÄÎÊÌâÊÇ¿ÉÏë¶øÖªµÄ.³ÌÐòÔ±²»µÃ²»ÎªÁ˱ÜÃâËÀËø,Ḭ̈߳²È«µÈÎÊÌâ,½øÐдóÁ¿µÄ±àÂëºÍ²âÊÔ.ºÜ¶àÈ˶¼ÔÚ±§Ô¹ÎªÊ²Ã´²»ÔÚJavaÖÐÒýÈëÒì²½ÊäÈëÊä³ö ......
[ת]http://www.java3z.com/cwbwebhome/article/article2/2414.html?id=1101
/*
ÍøÒ³ÖÐµÄ±íµ¥Ê¹ÓÃPOST·½·¨Ìύʱ£¬Êý¾ÝÄÚÈݵÄÀàÐÍÊÇ application/x-www-form-urlencoded£¬ÕâÖÖÀàÐͻ᣺
1.×Ö·û"a"-"z"£¬"A"-"Z"£¬"0"-"9"£¬"."£¬"-"£¬"*"£¬ºÍ"_" ¶¼²»»á±»±àÂë;
2.½«¿Õ¸ñת»»Îª¼ÓºÅ (+) ;
3.½ ......