JAVAÅäÖÃJNDIÊý¾ÝÔ´
±¾°¸ÀýÊÇʹÓÃSQLSERVER2005×÷ΪÊý¾ÝÔ´£¬Ê¹ÓÃTOMCAT6.0
µÚÒ»²½£¬°ÑÒÔÏ´úÂ뿽±´µ½tomcatµÄ°²×°Ä¿Â¼confÎļþ¼Ðcontext.xmlÎļþÏ¡£
Êý¾Ý¿âÁ¬½ÓÇëÐÞ¸Ä
<Resource name="jdbc/demo"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;databaseName=Demo"
username="sa"
password=""
maxActive="100"
maxIdle="30"
maxWait="10000" />
µÚ¶þ²½£¬°Ñjdbc¼Ü°ü¿½±´µ½tomcat°²×°Ä¿Â¼libÏÂ
µÚÈý²½£¬ÔÚ³ÌÐòÀïдÈçÒÔÏ´úÂë
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
public static Connection getConn(){
Connection con=null;
try {
Context ctx=new InitialContext();
DataSource ds=(DataSource) ctx.lookup("java:comp/env/jdbc/demo");
if(ds==null){
System.out.println("Êý¾ÝÔ´²»ÕýÈ·");
}else{
con=ds.getConnection();
}
}catch (Exception e) {
// TODO Auto-generated catch block
e.getMessage();
}
return con;
}
µÚËIJ½£¬Æô¶¯tomcat²ÅÄܲâÊÔ
Ïà¹ØÎĵµ£º
package com.xinnuo.jdbc;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.Date;
/*
* ¸ÃÀàÖ»ÄÜ´´½¨Ò»¸öʵÀý£¬ÆäËü¶ÔÏóÄܹ»µ÷ÓÃÆä¾²Ì¬·½·¨£¨Ò²³ÆÎªÀà·½·¨£©»ñµÃ¸ÃΨһʵÀýµÄÒýÓá£
* DBConnectionManagerÀàµÄ½¨¹¹º¯ÊýÊÇ˽Óеģ¬ÕâÊÇΪÁ˱ÜÃâÆäËü¶ÔÏó´´½¨¸ÃÀ ......
ÏëÏë×Ô¼ºÃ÷Äê¾ÍÒª±ÏÒµÁË£¬µ«×Ô¼ºÐÄÀï×ÜÊǺܵ£ÐÄ£¬Ò²²»ÖªµÀ×Ô¼ºÑ§Õâ¸öµ½µ×ÊǶԻ¹ÊÇ´í£¡×ÜÊÇÌý˵ÏÖÔÚ×ö³ÌÐòµÄ¹¤×÷²»ºÃÕÒ£¬¹¤×ʺܵͣ¬ÏÖÔÚÓкöàͬѧ¶¼Ã»Ñ§ÁË£¬Ò²²»ÖªµÀ×Ô¼ºÊDz»ÊÇ»¹Òª¼á³ÖÏÂÈ¥£¬ÊDz»ÊÇ»¹ÒªjiavaÕâÌõ·¡£¸Ð¾õºÃÃÔã....... ......
--°ü
create or replace package pkg_query as
type cur_query is ref cursor;
end pkg_query;
--¹ý³Ì
CREATE OR REPLACE PROCEDURE "PRC_QUERY" (p_tableName
in varchar2, --±íÃû
& ......
http://hi.baidu.com/suofang/blog/item/b4190de9846ea53eb80e2d1e.html
Äõ½ÁËÏîÄ¿¿ò¼Ü¹¤³Ì´úÂëȴûÓÐumlͼ£¬ÄÇô·½·¨Ö®¼äµÄµ÷ÓùØÏµ¹¦ÄÜÁ÷ת¾Í²»ÈÝÒ׿´³öÀ´£¬ÄÇôÈçºÎ²úÉúÀàÍ¼ÄØ?
1.н¨Ò»¸öROSE¹¤³Ì£¬Ñ¡ÔñJ2EEÄ£°å,
2.Èçͼ
3.ÔÚ³öÏֵĽçÃæÖУ¬CLASSPATHÖмÓÈëÔ´´úÂëµÄĿ¼£¬¼ÓÈëÖ§³ÖµÄ°ü£¬µã'ADD RECURSIVE'µã ......
2009-08-18 15:49
////ÉèÖþÓÖУ¨×¢Ò⣬ҪÔÚÉèÖô°Ìå´óСÏÂÃæÉèÖøþ䣩
this.setLocationRelativeTo(null);
********************
String[] kecheng = {"Java","Ó¢Óï","Êýѧ"};
JComboBox jComboBox3 = new JComboBox(kecheng);
JComboBox jComboBox2 = new JComboBox();
******* ......