JAVAʵÏÖOracleÊý¾Ý¿âµÄÊý¾ÝµÄ·ÖÒ³ÏÔʾ
×î½üѧÁËservletºÍoracle£¬Ò²¾Í°ÑËûÃǽáºÏÏ£¬×ö¸ö·ÖÒ³µÄÒ³Ãæ³öÀ´¡£ËãÊÇÒ»ÖÖ¸´Ï°°É¡£
1.Ê×ÏÈÊÇoracleµÄ·ÖÒ³ÏÔʾSQLÓï¾ä£º
select * from(select a.*, rownum rn from (select * from Person) a where rownum <= MaxNum) where rn > MinNum;
2.È»ºóÔÚjavaÖУ¬Á¬½ÓÊý¾Ý¿âµÄÓï¾äÓÐÏÂÃ漸¶Î£º
//¼ÓÔØÇý¶¯
Class.forName("oracle.jdbc.driver.OracleDriver");
//´ò¿ªÊý¾Ý¿â
Connection ct = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:myora1", "sys as sysdba", "abc");
/*
*Õâ¸öº¯ÊýÓÐÈý¸ö²ÎÊý
*µÚÒ»¸ö²ÎÊý jdbc:oracle:thin@ + IPµØÖ· + ¶Ë¿ÚºÅ + Êý¾Ý¿âÃû
*µÚ¶þ¸ö²ÎÊý Óû§Ãû
*µÚÈý¸ö²ÎÊý ÃÜÂë
*/
//´´½¨Á¬½ÓÊý¾Ý¿âµÄ»á»°
Statement sm = ct.createStatement();
//ÉèÖÃSQLÓï¾ä
ResultSet rs = sm.executeQuery("............");
3.É趨·ÖÒ³µÄËĸö¹Ø¼üÖµ
int pageSize = 5; //Ò»Ò³ÏÔʾµÄÌõÄ¿Êý ×Ô¼ºÉ趨
int pageNow = 1; //µ±Ç°µÄÒ³Êý ³õʼֵΪ1
int rowCount = 0; //Ò»¹²µÄ¼Ç¼Êý
int pageCount = 0; //Ò»¹²µÄÒ³Êý
µÚ¶þ¸öÊÇÓû§Ñ¡¶¨³öÀ´µÄ£¬ËùÒÔ¼ÓÉÏ
String id = (String)req.getParameter("id");
if(!(id == null || id.equals("")))
{
pageNow = Integer.parseInt(id);
}
ÏÂÃæÁ½¸öÊÇÒª¼ÆËã³öÀ´µÄ~
rowCount:
ResultSet rst = sm.executeQuery("select count(*) from Person");
while(rst.next())
{
rowCount = rst.getInt(1);
}
pageCount:
pageCount = (rowCount % pagesize == 0) ? rowCount / pageSize : rowCount / pageSize + 1;
OK,»ù±¾ÒªËؽ²ÍêÁË£¬ÏÂÃæÉÏÍêÕûCode£º
package com.testing;
import javax.servlet.http.*;
import java.io.*;
import javax.servlet
Ïà¹ØÎĵµ£º
µ¥Ðк¯Êý:
º¯ÊýÀà±ð:
µ¥ÐÐ:·µ»Øµ¥¸ö½á¹û:substr,length
¶àÐÐ:·µ»Ø¶à¸ö½á¹û,any,all
µ¥ÐеķÖÀà:
×Ö·ûÀ࣬ÈÕÆÚÀ࣬Êý×ÖÀ࣬ת»»À࣬ͨÓÃÀà
1.×Ö·ûÀà
ת»»´óСд:
lower:ת»»ÎªÐ¡Ð´
Select ENAME,LOWER(ENAME) from EMP
upper:ת»»Îª´óд
Select upper( ......
10ÔÂ10ÈÕµÄÃÀ¹ú¾É½ðɽһÏÂÓ¿ÈëÁË4ÍòÈËÁ÷£¬ËûÃǾۼ¯ÔھɽðɽµÄMoscone»áÕ¹ÖÐÐÄ£¬ÖÜΧ81000¸ö¾Æµê´²Î»±»¶©¹ºÒ»¿Õ£¬¾É½ðɽÊÐÕþ¸®×¨ÃÅ·âËøÁËÖܱßÈýÌõµÀ·µÄ½»Í¨£¬ÒÔΪÕâЩÅÓ´óÈËÁ÷Ìṩ±ãÀû¡£ÕâЩÈ˶¼ÊÇÈ«ÇòITÒµ½çµÄ¾«Ó¢——´ÓIT¾ÞÍ·µÄÁìÐäµ½ÆÕͨµÄÆóÒµIT¼¼ÊõÈËÔ±£¬´Ó×Éѯ»ú¹¹µÄ·ÖÎöÈËÊ¿µ½¸÷ÐÐÒµµÄÐÅÏ¢»¯Ö÷¹Ü£¬µ ......
//±¾³ÌÐòÁ¬½ÓµÄÊÇsql server 2005£¬ÓëÁ¬½Ósql server 2000Óе㲻ͬ£ºdriverNameºÍURL¶¼²»Í¬
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class create{
public void getConnection() th ......
ANT-build.xmlÎļþÏê½â
http://www.diybl.com/course/3_program/java/javajs/20081122/152210.html#
AntµÄ¸ÅÄî
¿ÉÄÜÓÐЩ¶ÁÕß²¢²»Àí½âʲôÊÇAntÒÔ¼°Èë¿ÉʹÓÃËü£¬µ«Ö»ÒªÊ¹ÓÃͨ¹ýLinuxϵͳµÃ¶ÁÕߣ¬Ó¦¸ÃÖªµÀmakeÕâ¸öÃüÁî¡£µ±±à
ÒëLinuxÄں˼°Ò»Ð©Èí¼þµÄÔ´³ÌÐòʱ£¬¾³£ÒªÓÃÕâ¸öÃüÁî¡£Make ......
ÉîÈëÀí½âjava¶à̬ÐÔ
×òÌì¿´µ½Ò»¸ö¹ØÓÚ¶à̬ÐÔµÄÌû×Ó£¬²Î¿¼ÁË»ØÌûÕßµÄÀí½â£¬¼ÓÈëÁËһЩ×Ô¼ºµÄ¿´·¨£¬ÕûÀí³öÀ´¹©´ó¼Ò²Î¿¼£¬²»Ò»¶¨ ......