锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品福利在线观看,国产精品高清视亚洲精品,国产午夜亚洲精品理论片不卡 http://m.tkk7.com/cavenaghi/zh-cnMon, 12 May 2025 00:22:34 GMTMon, 12 May 2025 00:22:34 GMT60鏁版嵁搴撹繛鎺ュぇ鍏?http://m.tkk7.com/cavenaghi/archive/2005/07/27/8551.htmlCavenaghiCavenaghiWed, 27 Jul 2005 07:19:00 GMThttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8551.htmlhttp://m.tkk7.com/cavenaghi/comments/8551.htmlhttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8551.html#Feedback0http://m.tkk7.com/cavenaghi/comments/commentRss/8551.htmlhttp://m.tkk7.com/cavenaghi/services/trackbacks/8551.html涓嬮潰鐨勬槸鍑犵甯歌鏁版嵁搴撶郴緇熺殑鏁版嵁搴撹繛鎺ユ柟寮?/P>

緋葷粺鐜:win2003 + j2se5.0 + tomcat5.5.7

鍓嶆彁鏄綘宸茬粡浠庣綉涓婂凡緇忎笅杞戒簡(jiǎn)鍚勪釜鏁版嵁搴撶殑JDBC鏀寔錛?BR>鎶婇偅浜涗富瑕佺殑宸ュ叿鍖呴兘鏀懼埌Tomcat 5.5\common\lib灝辮錛?BR>鍒ㄩ櫎閭d簺鍏ラ棬鐨勪笢瑗垮惂錛岀幇鍦ㄥ紑濮嬫鍏ユ棰橈紒
涓轟簡(jiǎn)鍑忓皯綃囧箙錛屾洿涓轟簡(jiǎn)鎶婇棶棰樿鐨勭洿瑙傦紝鎴戝凡緇忔妸寮傚父鎹曟崏浠g爜緇欏幓闄や簡(jiǎn)錛?/P>

1.Microsoft SQL Server 2000

 Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
 Connection conn= DriverManager.getConnection
  ("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=鏁版嵁搴撳悕瀛?,"sa","pwd");
 Statement stmt=conn.createStatement();
 //澧炲姞鍜屾煡璇㈣鍙?BR> stmt.executeUpdate("insert into boya values('mssql','2000')");
 ResultSet rs=statement.executeQuery("select * from boya");
 //鏄劇ず璁板綍
 while(rs.next()){
  out.print(rs.getString(1)+"  "+rs.getString(2));
  out.println("<br>");
 }

2.MySQL 5.0

 Class.forName("com.mysql.jdbc.Driver");
 Connection conn = DriverManager.getConnection
  ("jdbc:mysql://localhost/鏁版嵁搴撳悕瀛?user=root&password=pwd");
 Statement stmt=conn.createStatement();
 //澧炲姞鍜屾煡璇㈣鍙?BR> stmt.executeUpdate("insert into boya values('mysql','5.0')");
 ResultSet rs=stmt.executeQuery("select * from boya");
 //鏄劇ず璁板綍
 while(rs.next()){
  out.print(rs.getString(1)+"  "+rs.getString(2));
  out.println("<br>");
 }

3.PostgreSQL 8.0

 //榪欎釜鏈嶅姟鍣ㄧ殑榛樿绔彛5432錛屽鏋滄洿鏀逛簡(jiǎn)錛屼唬鐮佷篃闇瑕佹洿鏀?BR> Class.forName("org.postgresql.Driver");
 Connection conn=DriverManager.getConnection
  ("jdbc:postgresql://localhost:5432/鏁版嵁搴撳悕瀛?user=admin&&password=pwd");
 Statement stmt=conn.createStatement();
 //澧炲姞鍜屾煡璇㈣鍙?BR> stmt.executeUpdate("insert into boya values('mysql','5.0')");
 ResultSet rs=stmt.executeQuery("select * from boya");
 //鏄劇ず璁板綍
 while(rs.next()){
  out.print(rs.getString(1)+"  "+rs.getString(2));
  out.println("<br>");
 }

4.ODBC

 //in my opinion 浼?xì)鍐橭DBC灝卞浜?jiǎn)锛岀幇鍦≒ostgreSQL銆丮YSQL閲屼篃閮芥湁ODBC鏀寔,浣嗛熷害鎱㈠晩!
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 Connection conn=DriverManager.getConnection("jdbc:odbc:test","","");
 Statement stmt=conn.createStatement();
 //澧炲姞鍜屾煡璇㈣鍙?BR> stmt.executeUpdate("insert into boya values('mysql','5.0')");
 ResultSet rs=stmt.executeQuery("select * from boya");
 //鏄劇ず璁板綍
 while(rs.next()){
  out.print(rs.getString(1)+"  "+rs.getString(2));
  out.println("<br>");
 }



Cavenaghi 2005-07-27 15:19 鍙戣〃璇勮
]]>
鍦↗SP緗戦〉涓婂疄鐜版湀鍘?http://m.tkk7.com/cavenaghi/archive/2005/07/27/8538.htmlCavenaghiCavenaghiWed, 27 Jul 2005 03:58:00 GMThttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8538.htmlhttp://m.tkk7.com/cavenaghi/comments/8538.htmlhttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8538.html#Feedback1http://m.tkk7.com/cavenaghi/comments/commentRss/8538.htmlhttp://m.tkk7.com/cavenaghi/services/trackbacks/8538.html鍦↗SP緗戦〉涓婂疄鐜版湀鍘?/P>

JSP銆佹湀鍘?/P>

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,java.text.*" %>
<html>
<head>
<title>鏈堝巻</title>
</head>
<body style="font-size:12px">
<%!
 /*澹版槑鍙橀噺*/
 String[] months = {"January", "February", "March", "April", "May", "June",
        "July", "August", "September", "October", "November", "December"};
 String[] months_cn = {"涓鏈?, "浜屾湀", "涓夋湀", "鍥涙湀", "浜旀湀", "鍏湀",
           "涓冩湀", "鍏湀", "涔?jié)鏈?, "鍗佹湀", "鍗佷竴鏈?, "鍗佷簩鏈?};
 public final static int dom[] = {
         31, 28, 31, 30,
         31, 30, 31, 31,
         30, 31, 30, 31
 };
%>
<%
 /*澶勭悊浜嬩歡*/
 boolean yyok = false;
 int yy = 0, mm = 0;
 String yyString = request.getParameter("year");
 if (yyString != null && yyString.length() >0) {
  try {
   yy=Integer.parseInt(yyString);
   yyok=true;
  }
  catch (NumberFormatException e) {
   out.println("騫翠喚涓嶅彲鐢?);
  }
  Calendar cal = Calendar.getInstance();
  if (!yyok)
   yy = cal.get(Calendar.YEAR);
  String mmString = request.getParameter("month");
  if (mmString == null) {
   mm = cal.get(Calendar.MONTH);
  }
  else {
   for (int i = 0; i < months.length; i++)
    if (months[i].equals(mmString)) {
     mm = i;
     break;
    }
  }
 }
%>
<form name="cal" method=post action="cal.jsp">
 璇烽夋嫨鏈堜喚:
  <select name="month">
   <%
    /*鍒濆鍖栬〃鍗?/
   for (int i = 0; i < months.length; i++) {
    if (i == mm)
     out.print("<option selected value=January>");
    else
     out.print("<option value="+months[i]+">");
    out.print(months_cn[i]);
    out.print("</option>");
   }
   %>
  </select>
 <br>璇瘋緭鍏ュ勾浠斤細(xì)
   <input type="text" size="5" name="year" value="<%=yy%>">&nbsp;&nbsp;
   <input type="submit" value="鏄劇ず">
</form>
<%
 int lead = 0;
%>
<table border="0" cellpadding="1" cellspacing="1" style="font-size:12px">
<tr height="20"><td colspan="7"><font color="#3399FF"><b><%= months[mm]%>  <%= yy%></b></font></td></tr>
<% GregorianCalendar calendar =  new GregorianCalendar(yy, mm ,1); %>
<tr><td><font color="#FF0000">Sun</font></td><td>Mon</td><td>Tue</td><td>Wed</td>
<td>Thu</td><td>Fri</td><td><font color="#FF0000">Sat</font></td></tr>
<%
 /*涓嬮潰鏄樉紺烘湀鍘嗙殑浠g爜*/
 lead = calendar.get(Calendar.DAY_OF_WEEK)-1;
 int dayInMonth = dom[mm];
 if (calendar.isLeapYear(calendar.get(Calendar.YEAR)) && mm == 1)
  ++dayInMonth;
 out.print("<tr>");
 for(int i = 0; i < lead; i++) {
   out.print("<td>&nbsp;</td>");
 }
 for(int i = 1; i <= dayInMonth; i++) {
  if ((i+lead) % 7 == 0 || (i+lead) % 7 == 1)
   out.print("<td align=\"center\"><font color=\"#FF0000\">"+i+"</font></td>");
  else
   out.print("<td align=\"center\">"+i+"</td>");
  if ((lead+i) % 7 == 0) {
   out.print("</tr></tr>");
  }
 }
 out.print("</tr>");
%>
</table>
</body>
</html>



Cavenaghi 2005-07-27 11:58 鍙戣〃璇勮
]]>
閫掑綊瀵繪眰榪峰鍑?guó)櫟\ http://m.tkk7.com/cavenaghi/archive/2005/07/27/8537.htmlCavenaghiCavenaghiWed, 27 Jul 2005 03:54:00 GMThttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8537.htmlhttp://m.tkk7.com/cavenaghi/comments/8537.htmlhttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8537.html#Feedback1http://m.tkk7.com/cavenaghi/comments/commentRss/8537.htmlhttp://m.tkk7.com/cavenaghi/services/trackbacks/8537.html榪峰鏂囦歡boya.ice錛?/P>

8
9
#########
#s0##0###
#0##00###
#0##0####
#0000####
#0##0####
#0##00e##
#0000####

 

package maze;
import java.io.*;
import java.util.*;
public class Maze{
 private char[][] maze;//榪峰鏁扮粍
 private int startX,startY,endX,endY;//榪峰璧風(fēng)偣錛岀粓鐐圭殑浣嶇疆
 private int x,y,step=0;//榪峰闀垮鍙?qiáng)姝ラ?BR> //渚濇嵁杈撳叆鐨勬枃浠跺悕鍒涘緩瀵硅薄
 private Maze(String fileName){
  try{
   LinkedList aList=new LinkedList();//鐢ㄤ簬瀛樺偍鏂囦歡姣忚鐨勫唴瀹?BR>   BufferedReader files=new BufferedReader(new FileReader("map\\"+fileName));
   //灝嗘瘡琛岀殑鍐呭渚濇鍔犲叆鍒癓inkedList涓?BR>   String temp=new String();
   int i=0;
   while((temp=files.readLine())!=null){
    aList.add(temp);
   }
   files.close();
   //璇誨彇騫惰緗糠瀹殑闀垮
   x=Integer.parseInt((String)aList.getFirst())+2;
   aList.removeFirst();
   y=Integer.parseInt((String)aList.getFirst())+2;
   aList.removeFirst();
   //渚濇嵁闀垮瀵硅糠瀹繘琛屽垵濮嬪寲
   maze=new char[x][y];
   //灝嗚糠瀹殑璧嬩簣澶栧洿澧?BR>   for(i=0;i<x;i++){
    maze[i][0]='#';
    maze[i][y-1]='#';
   }
   for(i=0;i<y;i++){
    maze[0][i]='#';
    maze[x-1][i]='#';
   }
   //灝哃inkedList涓唴瀹硅鍏ユ暟緇?BR>   Iterator it=aList.iterator();
   i=1;
   char[] row;
   while(it.hasNext()){
    temp=((String)it.next());
    row=new char[y-2];
    row=temp.toCharArray();
    for(int j=1;j<y-1;j++){
     maze[i][j]=row[j-1];
     if(maze[i][j]=='s'){
      startX=i;
      startY=j;
      maze[i][j]='0';
     }
     else if(maze[i][j]=='e'){
      endX=i;
      endY=j;
      maze[i][j]='0';
     }
    }
    i++;
   }
  }
  catch(FileNotFoundException e){
   System.out.println("File Name Input Wrong!!!");
  }
  catch(IOException e){
   System.out.println("Wrong Input!!!");
  }
 }
 //閫掑綊鏂規(guī)硶瀵繪壘璺緞
 private boolean findWay(int x,int y){
  if(maze[endX][endY]=='i')
   return true;
  else
   if(maze[x][y]=='0'){
    maze[x][y]='i';
    if(findWay(x-1,y))
     return true;
    else if(findWay(x+1,y))
     return true;
    else if(findWay(x,y+1))
     return true;
    else if(findWay(x,y-1))
     return true;
    else{
     maze[x][y]='c';
     return false;
    }
   }
   else return false;
 }
 //鎵撳嵃榪峰璺緞
 private void show(){
  maze[startX][startY]='s';
  maze[endX][endY]='e';
  for(int i=1;i<x-1;i++){
   for(int j=1;j<y-1;j++){
    if(maze[i][j]=='i'){
     maze[i][j]=' ';
     step++;
    }
    else if(maze[i][j]=='c') maze[i][j]='0';
    System.out.print(maze[i][j]);
   }
   System.out.println("");
  }
  System.out.println("I Have went "+step+" Steps To The End!");
 }
 public static void main(String arg[]){
  try{
   System.out.println("Boya(8*9)\n"+"Ice(10*12)\n"+"Sky(15*17)\n"+"Input the map name:");
   BufferedReader is=new BufferedReader(new InputStreamReader(System.in));
   for(;;){
    String input=new String();
    input=is.readLine().trim();
    if(input.equals("q")) break;
    else{
     Maze boya=new Maze(input+".ice");
     if(boya.findWay(boya.startX,boya.startY)){
      boya.show();
     }
     else System.out.println("No Ways to the end!");
    }
    System.out.println("Input another map name or input 'q' to quit:");
   }
   is.close();
  }
  catch(IOException e){
   System.out.println("Wrong Input!!!");
  }
  catch(NullPointerException e){
   System.out.println("Wrong Input!!!");
  }
 }
}



Cavenaghi 2005-07-27 11:54 鍙戣〃璇勮
]]>
鏁版嵁緇撴瀯JAVA紺轟緥---閫嗘嘗鍏板紡姹傚? http://m.tkk7.com/cavenaghi/archive/2005/07/27/8536.htmlCavenaghiCavenaghiWed, 27 Jul 2005 03:45:00 GMThttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8536.htmlhttp://m.tkk7.com/cavenaghi/comments/8536.htmlhttp://m.tkk7.com/cavenaghi/archive/2005/07/27/8536.html#Feedback1http://m.tkk7.com/cavenaghi/comments/commentRss/8536.htmlhttp://m.tkk7.com/cavenaghi/services/trackbacks/8536.htmlpackage expression;
public class Calculate{
 public static boolean isOperator(String operator){
  if(operator.equals("+")||operator.equals("-")||operator.equals("*")||operator.equals("/")||operator.equals("(")||operator.equals(")")) return true;
  else return false;
 }
 public static int priority(String operator){
  if(operator.equals("+")||operator.equals("-")||operator.equals("(")) return 1;
  else if(operator.equals("*")||operator.equals("/")) return 2;
  else return 0;
 }
 public static String twoResult(String operator,String a,String b){
  try{
   String op=operator;
   String rs=new String();
   double x=Double.parseDouble(b);
   double y=Double.parseDouble(a);
   double z=0;
   if(op.equals("+")) z=x+y;
   else if(op.equals("-")) z=x-y;
   else if(op.equals("*")) z=x*y;
   else if(op.equals("/")) z=x/y;
   else z=0;
   return rs+z;
  }
  catch(NumberFormatException e){
   System.out.println("input has something wrong!");
   return "Error";
  }
 }
}

 

 

package expression;
import java.util.*;
public class Stacks{
 private LinkedList list=new LinkedList();
 int top=-1;
 public void push(Object value){
  top++;
  list.addFirst(value);
 }
 public Object pop(){
  Object temp=list.getFirst();
  top--;
  list.removeFirst();
  return temp;

 }
 public Object top(){
  return list.getFirst();
 }
}

 

package expression;
import java.io.*;
import java.util.*;
public class Expression{
 private ArrayList expression=new ArrayList();//瀛樺偍涓簭琛ㄨ揪寮?BR> private ArrayList right=new ArrayList();//瀛樺偍鍙沖簭琛ㄨ揪寮?BR> private String result;//緇撴灉
 //渚濇嵁杈撳叆淇℃伅鍒涘緩瀵硅薄錛屽皢鏁板間笌鎿嶄綔絎︽斁鍏rrayList涓?BR> private Expression(String input){
  StringTokenizer st=new StringTokenizer(input,"+-*/()",true);
  while(st.hasMoreElements()){
   expression.add(st.nextToken());
  }
 }
 //灝嗕腑搴忚〃杈懼紡杞崲涓哄彸搴忚〃杈懼紡
 private void toRight(){
  Stacks aStack=new Stacks();
  String operator;
  int position=0;
  while(true){
   if(Calculate.isOperator((String)expression.get(position))){
    if(aStack.top==-1||((String)expression.get(position)).equals("(")){
     aStack.push(expression.get(position));
    }
    else{
     if(((String)expression.get(position)).equals(")")){
      if(!((String)aStack.top()).equals("(")){
       operator=(String)aStack.pop();
       right.add(operator);
      }
     }
     else{
      if(Calculate.priority((String)expression.get(position))<=Calculate.priority((String)aStack.top())&&aStack.top!=-1){
       operator=(String)aStack.pop();
       if(!operator.equals("(")) right.add(operator);
      }
      aStack.push(expression.get(position));
     }
    }
   }
   else right.add(expression.get(position));
   position++;
   if(position>=expression.size()) break;
  }
  while(aStack.top!=-1){
   operator=(String)aStack.pop();
   right.add(operator);
  }
 }
 //瀵瑰彸搴忚〃杈懼紡榪涜姹傚?BR> private void getResult(){
  this.toRight();
  Stacks aStack=new Stacks();
  String op1,op2,is=null;
  Iterator it=right.iterator();
  while(it.hasNext()){
   is=(String)it.next();
   if(Calculate.isOperator(is)){
    op1=(String)aStack.pop();
    op2=(String)aStack.pop();
    aStack.push(Calculate.twoResult(is,op1,op2));
   }
   else aStack.push(is);
  }
  result=(String)aStack.pop();
  it=expression.iterator();
  while(it.hasNext()){
   System.out.print((String)it.next());
  }
  System.out.println("="+result);
 }
 public static void main(String avg[]){
  try{
   System.out.println("Input a expression:");
   BufferedReader is=new BufferedReader(new InputStreamReader(System.in));
   for(;;){
    String input=new String();
    input=is.readLine().trim();
    if(input.equals("q")) break;
    else{
     Expression boya=new Expression(input);
     boya.getResult();
    }
    System.out.println("Input another expression or input 'q' to quit:");
   }
   is.close();
  }
  catch(IOException e){
   System.out.println("Wrong input!!!");
  }
 }
}



Cavenaghi 2005-07-27 11:45 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲码和欧洲码一码二码三码 | 美女18毛片免费视频| 91人成网站色www免费下载| 国产精品久久久亚洲| a级毛片高清免费视频就| 久久亚洲国产成人影院网站| 产传媒61国产免费| 国产精品亚洲mnbav网站 | 99精品国产免费久久久久久下载| 亚洲精品在线播放视频| 91老湿机福利免费体验| 亚洲jjzzjjzz在线观看| 成人免费淫片在线费观看| 亚洲依依成人亚洲社区| 国产在线a不卡免费视频| 青娱乐在线视频免费观看| 亚洲第一视频在线观看免费| 成年网站免费入口在线观看 | 亚洲精品GV天堂无码男同| 国内大片在线免费看| 国产区图片区小说区亚洲区| 亚洲人妻av伦理| 久久国产精品国产自线拍免费| 久久青青草原亚洲AV无码麻豆| 国产精品成人免费福利| 亚洲中文无码永久免费| 免费一级毛片在级播放| 中文字幕无码毛片免费看| 亚洲高清视频在线播放| 成年人网站在线免费观看| 国产亚洲综合久久| 亚洲VA成无码人在线观看天堂| 1000部国产成人免费视频| 亚洲AV无码成人精品区狼人影院 | 免费无码又爽又刺激高潮软件 | 国产亚洲av人片在线观看| 99视频在线精品免费| 亚洲一区AV无码少妇电影| 免费一区二区视频| 无码成A毛片免费| 亚洲日本VA午夜在线电影|