java²Ù×÷oracleÊý¾Ý¿â
package com.chinacache.boss.queryservice.service.impl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.chinacache.boss.queryservice.exception.BusinessException;
import oracle.sql.ArrayDescriptor;
public class Main {
public static void main(String[] args) throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
java.sql.Array sqlArray = null;
conn = getOracleConnection();
// For oracle you need an array descriptor specifying
// the type of the array and a connection to the database
// the first parameter must match with the SQL ARRAY type created
ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor(
"CHAR_ARRAY", conn);// CREATE OR REPLACE TYPE CHAR_ARRAY AS table OF VARCHAR2(255)
// then obtain an Array filled with the content below
String[] content = { "5137", "V2", "V3", "V4" };
sqlArray = new oracle.sql.ARRAY(arrayDescriptor, conn, content);
pstmt = conn.prepareStatement(""
+ "select * "
+ "from bandwith_area_test t where t.channel_id in (select * from the (select cast(? as CHAR_ARRAY) from dual)) and t.area_id = ?" + "and t.day >= ? and t.day <= ? order by t.day");
Date start = null;
Date end = null;
try {
SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmm");
start = df.parse("200907011000");
end = df.parse("200907012000");
} catch (ParseException e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
pstmt.setArray(1, sqlArray);
pstmt.setString(2, "9050");
pstmt.setDate(3, new java.sql.Date(start.getTime()));
pstmt.setDate(4, new java.sql.Date(end.getTime()));
int rowCount = pstmt.executeUpdate();
System.out.println("rowCount=" + rowCount);
System.out.println("--Demo_PreparedStatement_SetArray end--");
pstmt.close(
Ïà¹ØÎĵµ£º
ÔÎijö´¦£ºhttp://developers.sun.com/techtopics/mobility/midp/articles/wtk23beta/
Sun Java Wireless ToolkitÔ½À´Ô½ºÃ£¬2.3beta°æ±¾Ôö¼ÓÁ˶ÔÓÚÈýÖÖеÄAPIµÄÖ§³Ö£º
l The Security and Trust Services APIs (SATSA, ......
StrutsME Ò»¸öÇáÁ¿¼¶µÄÐòÁл¯ÐÒ飬ʹJ2ME¿Í»§¶ËÄܵ÷ÓÃStruts WebÓ¦ÓóÌÐò¡£
http://www.strutsme.org/
JsonME ÇáÁ¿¼¶ÊµÏÖJ2ME Json¡£
http://www.json.org/java/org.json.me.zip
MicroLog ÇáÁ¿¼¶µÄLOG
http://microlog.sourceforge.net/snapshot
Mobile Ajax for Java ME °üÀ¨ÁËXmlHttpRequest£¬jsonµÄÒ ......
xmlµÄÓ¦ÓÃÔ½À´Ô½¹ã·º£¬³ÃÎÞÊÂʱ£¬ÕÒÁËһƪÎÄÕÂת¹ýÀ´£¬ÒÔ±¸ÒÔºóѧϰ¡£ÒÔÏÂÊÇÎÄÕÂÄÚÈÝ¡£
1. ½éÉÜ
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëÆ½Ì¨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐѰÕÒÌØ ......
ÔÚ·Ö²¼Ê½·þÎñ¿ò¼ÜÖУ¬Ò»¸ö×î»ù´¡µÄÎÊÌâ¾ÍÊÇÔ¶³Ì·þÎñÊÇÔõôͨѶµÄ£¬ÔÚJavaµ×²ãÁìÓòÖÐÓкܶà¿ÉʵÏÖÔ¶³ÌͨѶµÄ¼¼Êõ£¬ÀýÈ磺RMI¡¢MINA¡¢ESB¡¢Burlap¡¢SOAP¡¢EJBºÍJMS µÈ£¬ÔÚj2eeÖÐ,¶Ôjavaµ×²ãÔ¶³ÌͨѶµÄ¼¼Êõ½øÐÐÁË·â×°,ÐγÉÁË Hessian ¡¢ HttpInvoker ¡¢ XFire ¡¢ Axis µÈ¶àÖÖÐÎʽµÄÔ¶³Ìµ÷Óü¼Êõ¡£ µ«¶Ô¸ß¼¶³ÌÐòÔ±¶øÑÔÈÔÐ ......