±Ø±¸sqlÓï¾ä
1.¶Á³ö±íÖеÄ×Ö¶ÎÃû
ResultSet rs = test.selectSql("SELECT * from datainfo");
java.sql.ResultSetMetaData md=rs.getMetaData(); //¶Á³öÊý¾Ý¿âµÄ×Ö¶ÎÃû
int nColumn=md.getColumnCount(); //×Ö¶Î×ÜÊý
for(int i=0;i<nColumn;i++)
{
System.out.println(md.getColumnLabel(i+1)); //md.getColumnLabel(n)nÊÇ´Ó1¿ªÊ¼µÄ,´òӡÿ¸ö×Ö¶Î
}
2.²éѯij¸öʱ¼ä¶ÎÄÚµÄÊý¾Ý
String sql="select * from datainfo where time between '"+start+"' and '"+end+"'"; ȡʱ¼ä¶ÎÄÚµÄÊý¾Ý
select * from datainfo where time between "2009-11-03 11:16:59"and "2009-11-03 11:18:59"
3.°´Ä³¸ö×ֶνµÐòÅÅÁв¢Ñ¡È¡µÚÒ»¸ö
sql="select * from datainfo,nodeinfo where nodeinfo.nodeid="+Integer.parseInt(param)+" and nodeinfo.nodeip=datainfo.ip
order by time desc limit 0,1"; °´Ê±¼ä½µÐòÅÅÁРֻȡµÚÒ»¸ö
£¨limit 0,1 ÊÇֻȡ¼Ç¼ÖеĵÚÒ»Ìõ.ËùÒÔÕâÌõÓï¾äÖ»Äܵõ½Ò»Ìõ¼Ç¼
ÈçÏëȡǰ10ÌõÔò limit 0,10»òlimit 10
ÈçÏëÈ¡µÚ10ÖÁ20ÌõÔò limit 10,20 £©
4.³öÏÖOperation not allowed after ResultSet closedµÄ´íÎó
Ò»¸östmt¶à¸örs½øÐвÙ×÷.ÄÇô´ÓstmtµÃµ½µÄrs1,±ØÐëÂíÉϲÙ×÷´Ërs1ºó,²ÅÄÜÈ¥µÃµ½ÁíÍâµÄrs2,ÔÙ¶Ôrs2²Ù×÷.²»ÄÜ»¥Ïà½»ÌæÊ¹ÓÃ,»áÒýÆðrsÒѾ¹Ø±Õ´íÎó. ´íÎóµÄ´úÂëÈçÏÂ:
stmt=conn.createStatement();
rs=stmt.executeQuery("select * from t1");
rst=stmt.executeQuery("select * from t2"); rs.last();
//ÓÉÓÚÖ´ÐÐÁËrst=stmt.executeQuery(sql_a);rs¾Í»á±»¹Ø±Õµô£¡ËùÒÔ³ÌÐòÖ´Ðе½´Ë»áÌáʾResultSetÒѾ¹Ø±Õ.
´íÎóÐÅϢΪ:java.sql.SQLException: Operation not allowed after ResultSet closed rst.last();
ÕýÈ·µÄ´úÂë:
stmt=conn.createStatement();
rs=stmt.executeQuery("select * from t1");
&n
Ïà¹ØÎĵµ£º
×÷Õߣº sealyu ÈÕÆÚ£º2008-04-17
ÔÚSQL Server ÖУ¬Èç¹û¸ø±íµÄÒ»¸ö×Ö¶ÎÉèÖÃÁËĬÈÏÖµ£¬¾Í»áÔÚϵͳ±ísysobjectsÖÐÉú³ÉÒ»¸öĬÈÏÔ¼Êø¡£
Èç¹ûÏëɾ³ýÕâ¸öÉèÖÃÁËĬÈÏÖµµÄ×ֶΣ¨¼ÙÉè´Ë×Ö¶ÎÃûcolumn1£©£¬
Ö´ÐГALTER TABLE table1 DROP COLUMN column1”ʱ¾Í»á±¨´í£º
The object 'DF__xxxxxxxxxxx' ......
°æÈ¨ÉùÃ÷£ºÔ´´×÷Æ·£¬ÈçÐè×ªÔØ£¬ÇëÓë×÷ÕßÁªÏµ¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£
DB2ÁÙʱ±íÔÚSQL¹ý³ÌºÍSQLÓï¾äÖеIJâÊÔ×ܽá
²âÊÔÄ¿±ê£º
·Ö±ðÔÚSQL¹ý³ÌºÍSQLÓï¾äÖд´½¨ÁÙʱ±í£¬²¢²åÈëÊý¾Ý£¬¿´Ö´Ðнá¹ûÓÐʲôÒìͬ¡£
²âÊÔ»·¾³£º
DB2 UDB V9.1
Ö´Ðи½¼þÀïÃæµÄSQLÓï¾ä£¬µÃµ½Ò»¸ö±í¡ ......
Ò»Ö±¶¼ÏëÕÒ¸öʱ¼äÑо¿Ò»Ï£¬½ñÌ컨ÁËÒ»Ììʱ¼äȥʵ¼ùÁËһϣ¬·Ç³£ÓÐÓ᣿ÉÒÔ˵ÊÇÊý¾Ý¿âÀïÃæµÄ¾«»ª°É¡£»¹ºÃÎÒ½ñÌìȥŪÁ˼¸Ï£¬Ëä˵¶¼ÊÇЩ¼òµ¥µÄÓï¾ä£¬µ«ÊÇ×îÆðÂëÖªµÀÒÔºóÔÚÏîÄ¿¸ÃÔõôȥ×öÁË¡£ Ïл°ÉÙ˵¡£½øÈëÕýÌâ¡£
1.´´½¨SQL´æ´¢¹ý³Ì:
CREATE PROCEDURE stu_proc1//Ö¸¶¨¹ý³ÌÃû
@Sno varc ......
Introducing Oracle Database 11g
List the features of Oracle Database 11g
Discuss the basic design, theoretical and physical aspects of a relational database
Categorize the different types of SQL statements
Describe the data set used by the course
Log onto the database using the SQL Develope ......
shopxpÍøÉϹºÎïϵͳ v7.4´æÔÚSql×¢Èë©¶´¡£
ÎÊÌâÎļþ£ºxpCatalog_xpDesc.asp£¬xpCatalog_xpsmall_Desc.asp
ÎÊÌâ´úÂ룺
<%
dim shopxpbe_id, anclassname, shopxpse_id, nclassname
dim totalPut
dim CurrentPage, TotalPages
if request("shopxpbe_id")<>"" then
shopxpbe_id=request("shopxpbe_id")
e ......