JAVAѧϰµÄÊý¾Ý¿âÁ¬½Ó£¬Àý×ÓÒ»Ö»¡¡
³õѧJAVA£¬ºÃ²»ÈÝÒ×½â¾öÁËÕâ¸öÊý¾Ý¿âÁ¬½ÓÎÊÌ⣬Õâ¸öÖ÷ÒªÊÇÓÐÁ½¸öÎÊÌ⣬һ¸öÊÇJDBC-odbcµÄÎÊÌ⣬Èç¹ûûÓнâ¾öºÃÊý¾ÝÔ´ÅäÖ㬾ø¶ÔÊÇÓÐÈÝÒ׳öÎÊÌâµÄ£¬¼ÙÉèÄãʹÓõÄÊÇaccessµÄÊý¾Ý¿â£¬ÕâÊÇÍøÉϵÄÒ»¸öÀý×ÓµÄÓï¾ä
String dburl="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=database.mdb";
Æäʵ²¢²»ÐèÒªÄÇô³¤£¬¼ÙÉèÄãµÄÊý¾ÝÔ´ÃûΪbook,String dburl="jdbc:odbc:book";ÕâÑù¾ÍÄÜ·ÃÎÊÁË£¬ÉÏÃæµÄд·¨Ó¦¸ÃÒ²¿ÉÒÔ£¬µ«ÊDZ¾ÈËû³É¹¦£¬
¹À¼ÆÊÇÒòΪʹÓÃÁ˾ø¶Ô·¾¶µÄÔÒò¡£
ÎÒдÁË°ëÌ죬ÒòΪÊǸö²ËÄñ£¬ËùÒÔʵÔÚÊÇÄÑÊÜ£¬×ÜËãд³ö¸öÄÜÓõÄÁ½¸öÊý¾Ý¿âµÄ²éѯµ÷Óã¬ÆäʵÔÚÕâÀïÎÒÖ»ÓÃÁËÒ»¸öÊý¾Ý¿â£¬²»¹ýÁ½¸öÒ²ÊÇÍêÈ«¿ÉÒԵġ£
ÕâÀï¾ÍÉæ¼°µ½ÁíÒ»¸öÎÊÌ⣬Êý¾ÝÀàÐ͵ÄÎÊÌ⣬ÎÒÊÇ×ÔѧµÄ£¬¶ÔÓÚÕâ¸öʵÔÚÊÇûÓоÑ飬Ȩµ±Êǽ»ÁËѧ·ÑÁË……Ô´´úÂëÈçÏ£º
import java.sql.*;
public class Sms {
String str1="";
public String myforum(){
try{
String strurl="jdbc:odbc:myforum";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection(strurl);
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select id from tdcode WHERE sim='13461544271'");
while(rs.next()){
str1=rs.getString(1);
}
rs.close();
stmt.close();
}catch(Exception e){
}return str1;
}
public void myforum2(String str1){
try{
String strurl="jdbc:odbc:myforum";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection(strurl);
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select user from tdcode WHERE id="+str1+"");
while(rs.next()){
System.out.println(rs.getString(1));
}
rs.close();
stmt.close();
}catch(Exception e){
e.printStackTrace();
}
}
public void run(){
myforum();
myforum2(str1);
}
public static void main(Strin
Ïà¹ØÎĵµ£º
¹Ø¼üÓï¾ä£º
conn.setAutoCommit(false);
if(!ok) conn.rollBack();
// after all done
conn.commit();
conn.setAutoCommit(true);
ǧÍò±ðÍü¼ÇÒª¼Óconn.commit()·ñÔò²»»áÖ´ÐÐÊÂÎñµÄ¡£
ÁíÍ⣬M ......
annotationʹÓÃ
2010Äê2ÔÂ11ÈÕ ÁɹúÅÖÅÖ
½ñÌì¿´annotation¹æ·¶£¬ÌؼǼÈçÏ£¬ÒÔ±ãÒÔºó²Î¿¼£¬Ò²¹©³õѧµÄÅóÓÑÃÇÒ»¸ö¿ÉÔËÐа¸Àý£¬Óв»Í×Ö®´¦£¬ÇëÖ¸ÕýÐ޸ģ»ÁíÍ⣬ÌرðÉùÃ÷£¬Èç¹ûתÔØ»òÕßÒýÓÃÇë×¢Ã÷³ö´¦¡£
½éÉÜ
AnnotationÊÇjava5ÐÂÌí¼ÓµÄÌØÐÔ£¬ annotationÊÇÒ»ÖÖÔªÊý¾ ......
ÔÚJava ÖÐÊý¾ÝÀàÐ͵Ä×Ô¶¯×ª»»ÀÏÊdzöÏÖһЩÎÊÌâ
byte b1 =1 , b2 = 12; //Äܹ»Í¨¹ý
byte b3 = 128 //±àÒëµÄʱºò²»ÄÜͨ¹ý
ÎÒÃÇÖªµÀJavaÖÐÊý¾ÝÀàÐÍbyte shout char ÔÚ½øÐмÆËãµÄʱºò¶¼ÊÇ» ......
ÔÎÄÒý×Ôhttp://hi.baidu.com/heyinjie/blog/item/608ee7108f1f4802203f2e35.html
´ò¸ö±È·½£ºÒ»¸öobject¾ÍÏñÒ»¸ö´ó·¿×Ó£¬´óÃÅÓÀÔ¶´ò¿ª¡£·¿×ÓÀïÓкܶ෿¼ä£¨Ò²¾ÍÊÇ·½·¨£©¡£ÕâЩ·¿¼äÓÐÉÏËøµÄ£¨synchronized·½·¨£©£¬ ºÍ²»ÉÏËøÖ®·Ö£¨ÆÕͨ·½·¨£©¡£·¿ÃÅ¿Ú·Å×ÅÒ»°ÑÔ¿³×£¨key£©£¬Õâ°ÑÔ¿³×¿ÉÒÔ´ò¿ªËùÓÐÉÏËøµÄ·¿¼ä¡£ÁíÍâÎÒ°ÑËùÓÐÏë ......
ÒÔÏÂÖ»ÊǸöÈËÀí½â
½ñÌìѧϰspringÖеÄÊôÐÔ×¢È룬ÔÚ½²ÔÀíµÄʱºò£¬Ìáµ½ÁËjavaÖеÄÄÚÄÚÊ¡»úÖÆ£¬ÔÚÒÔÇ°Ö»ÊÇÁ˽âһϷ´Éä»úÖÆ¡£
·´Éä»úÖÆÊÇjavaÖеĶ¯Ì¬ÐÔÄÜ£¬¿ÉÒÔÒÔÀàÃûµÃµ½Àà¶ÔÏóµÄ¼¼Êõ£¬ÊµÏÖ¶¯Ì¬Éú³É¶ÔÏó¼¼Êõ£¬¿ÉÒÔÒÔ¶ÔÏóµÃµ½´Ë¶ÔÏóµÄÀàÐÅÏ¢£¨°üÀ¨ÊôÐÔ£¬·½·¨£©£¬ÊµÏִ˼¼ÊõµÄÊÇjavaÖеÄClass¶ÔÏ󣬴˶ÔÏóÊÇÃè ......