Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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×Ö·û±àÂëϵÁÐÈý£ºJavaÓ¦ÓÃÖеıàÂëÎÊÌâ

1. ¸ÅÊö
±¾ÎÄÖ÷Òª°üÀ¨ÒÔϼ¸¸ö·½Ã棺±àÂë»ù±¾ÖªÊ¶£¬java£¬ÏµÍ³Èí¼þ£¬url£¬¹¤¾ßÈí¼þµÈ¡£
ÔÚÏÂÃæµÄÃèÊöÖУ¬½«ÒÔ"ÖÐÎÄ"Á½¸ö×ÖΪÀý£¬¾­²é±í¿ÉÒÔÖªµÀÆäGB2312±àÂëÊÇ"d6d0 cec4"£¬Unicode±àÂëΪ"4e2d 6587"£¬UTF±àÂë¾ÍÊÇ"e4b8ad e69687"¡£×¢Ò⣬ÕâÁ½¸ö×ÖûÓÐiso8859-1±àÂ룬µ«¿ÉÒÔÓÃiso8859-1±àÂëÀ´"±íʾ"¡£
2. ±àÂë»ù±¾ÖªÊ ......

javaºº×ÖתƴÒô

package com.navinfo.mygim.admin.util;
/*
* Pinyin.java
* vicbay
*/
public class Pinyin{
private String[] name = { "zuo", "zun", "zui", "zuan", "zu", "zou",
"zong", ......

ÄÚ´æ¼àÊÓ Java Ô´´úÂë

/*
 * @(#)MemoryMonitor.java 1.3 05/11/17
 *
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are ......

mySQL¼òµ¥´´½¨Êý¾Ý¿â¡¢±í¡¢¸Ä±äÊý¾Ý¿â·¾¶

´´½¨Êý¾Ý¿â£º
mysql>create database test;
Query OK, 1 row affected (0.02 sec)
´´½¨Êý¾Ý¿â±í£º
mysql>use test;
Database changed
´´½¨Êý¾Ý¿â±í£º
myaql>create table user(SID VARCHAR(11), name VARCHAT(6) );
Query OK, 0 rows affected (0.08 sec)
²åÈë¼Ç¼£º
mysql>insert int use ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ