Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java+MysqlµÄÊý¾Ý¿â²éÕÒʵÏÖ


public class select {
 public List XiuGai_select(String keyword){
  List list=new ArrayList();
        Connection conn = null;
  Statement stmt = null;
  String sql=null;
  ResultSet res = null;
  getConnection b=new getConnection();
  conn=b.getconnection(); 
  sql="select * from book where bookName like'%"+keyword+"%'";
  try {
   stmt = conn.createStatement();
   res=stmt.executeQuery(sql);
   while (res.next()) {                                    //Èç¹û½á¹û¼¯²»Îª¿Õ£¬ÄÇôȡ³öÖµÊä³ö
       int id = res.getInt("id");
       String bookName= res.getString("bookName");
       String author= res.getString("author");
       String publisher= res.getString("publisher");
       int isBorrow=res.getInt("isBorrow");
       int isRenew=res.getInt("isRenew");
       Date dateOfBorrow=res.getDate("dateOfBorrow");
       int numberOfBook=res.getInt("numberOfBook");
       int numberOfNow=res.getInt("numberOfNow");
       int userId=res.getInt("userId");
       Book book = new Book(id,bookName,author,publisher,isBorrow,isRenew,dateOfBorrow,numberOfBook,numberOfNow,userId);
       list.add(book);
       
       System.out.println(id);
       System.out.println(b


Ïà¹ØÎĵµ£º

JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó


JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó——W3C DOM
JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó——W3C DOMƪÊÕ²Ø
ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml v ......

Java Application Ö±½Óͨ¹ýjndiÁ¬½ÓÊý¾Ý¿â

À´Ô´£ºhttp://www.ej38.com/showinfo/java-132636.html
ʹÓÃjar°ü:
 commons-pool-1.5.3.jar,tomcat-naming-common.jar,commons-pool-1.5.3-bin.zip,commons-dbcp.jar
 ×¢Òâ:jdbc Çý¶¯ÒªÓëÊý¾Ý¿â¼æÈÝ.
 package test.comm;
import java.sql.Connection;
import java.sql.SQLException;
import java.u ......

MYSQLÊý¾Ý¿âµ¼Èë¡¢µ¼³ö

1.mysqlµ¼³öÊý¾Ý¿âÃüÁî
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû (±íÃû) > c:\\ÎļþÃû.sql
2.mysqlµ¼ÈëÊý¾Ý¿âÃüÁî
£¨1£©½â¾öÖÐÎÄÂÒÂëÎÊÌ⣺ִÐÐÈçÏÂÃüÁîÔÙµ¼È룺set names utf8
£¨2£©µÇ¼mysql£¬Ö´ÐÐÈçÏÂÃüÁ
mysql> source c:\\ÎļþÃû.sql;
3½â¾öÖÐÎÄÂÒÂëÎÊÌ⣺ִР......

MySQLСÊýλȡÕû

//µÃ·Ö¼ÆËãËÄÉáÎåÈë
SELECT ROUND((SUM(getfeng)/SUM(totalfeng))*100) as feng from answerdata WHERE uid='151' AND targetid IS NOT NULL
1.ceil £¨£© /ceiling£¨£© ÏòÉÏÈ¡Õû
   Àý£º ceil£¨1.2£© = 2
2.floor £¨£© ÏòÏÂÈ¡Õû
    Àý£º floor£¨1.2£© = 1
3.round£¨£© ËÄÉáÎåÈë
 &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ