锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕精品亚洲无线码二区 ,亚洲综合成人网在线观看,精品久久久久久亚洲综合网http://www.tkk7.com/cavenaghi/zh-cnMon, 12 May 2025 00:40:14 GMTMon, 12 May 2025 00:40:14 GMT60鏁版嵁搴撹繛鎺ュぇ鍏?http://www.tkk7.com/cavenaghi/archive/2005/07/27/8551.htmlCavenaghiCavenaghiWed, 27 Jul 2005 07:19:00 GMThttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8551.htmlhttp://www.tkk7.com/cavenaghi/comments/8551.htmlhttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8551.html#Feedback0http://www.tkk7.com/cavenaghi/comments/commentRss/8551.htmlhttp://www.tkk7.com/cavenaghi/services/trackbacks/8551.html涓嬮潰鐨勬槸鍑犵甯歌鏁版嵁搴撶郴緇熺殑鏁版嵁搴撹繛鎺ユ柟寮?/P>

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

鍓嶆彁鏄綘宸茬粡浠庣綉涓婂凡緇忎笅杞戒簡鍚勪釜鏁版嵁搴撶殑JDBC鏀寔錛?BR>鎶婇偅浜涗富瑕佺殑宸ュ叿鍖呴兘鏀懼埌Tomcat 5.5\common\lib灝辮錛?BR>鍒ㄩ櫎閭d簺鍏ラ棬鐨勪笢瑗垮惂錛岀幇鍦ㄥ紑濮嬫鍏ユ棰橈紒
涓轟簡鍑忓皯綃囧箙錛屾洿涓轟簡鎶婇棶棰樿鐨勭洿瑙傦紝鎴戝凡緇忔妸寮傚父鎹曟崏浠g爜緇欏幓闄や簡錛?/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錛屽鏋滄洿鏀逛簡錛屼唬鐮佷篃闇瑕佹洿鏀?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 浼氬啓ODBC灝卞浜嗭紝鐜板湪PostgreSQL銆丮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://www.tkk7.com/cavenaghi/archive/2005/07/27/8538.htmlCavenaghiCavenaghiWed, 27 Jul 2005 03:58:00 GMThttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8538.htmlhttp://www.tkk7.com/cavenaghi/comments/8538.htmlhttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8538.html#Feedback1http://www.tkk7.com/cavenaghi/comments/commentRss/8538.htmlhttp://www.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 = {"涓鏈?, "浜屾湀", "涓夋湀", "鍥涙湀", "浜旀湀", "鍏湀",
           "涓冩湀", "鍏湀", "涔濇湀", "鍗佹湀", "鍗佷竴鏈?, "鍗佷簩鏈?};
 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>璇瘋緭鍏ュ勾浠斤細
   <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 鍙戣〃璇勮
]]>
閫掑綊瀵繪眰榪峰鍑鴻礬 http://www.tkk7.com/cavenaghi/archive/2005/07/27/8537.htmlCavenaghiCavenaghiWed, 27 Jul 2005 03:54:00 GMThttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8537.htmlhttp://www.tkk7.com/cavenaghi/comments/8537.htmlhttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8537.html#Feedback1http://www.tkk7.com/cavenaghi/comments/commentRss/8537.htmlhttp://www.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;//榪峰璧風偣錛岀粓鐐圭殑浣嶇疆
 private int x,y,step=0;//榪峰闀垮鍙婃楠?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!!!");
  }
 }
 //閫掑綊鏂規硶瀵繪壘璺緞
 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://www.tkk7.com/cavenaghi/archive/2005/07/27/8536.htmlCavenaghiCavenaghiWed, 27 Jul 2005 03:45:00 GMThttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8536.htmlhttp://www.tkk7.com/cavenaghi/comments/8536.htmlhttp://www.tkk7.com/cavenaghi/archive/2005/07/27/8536.html#Feedback1http://www.tkk7.com/cavenaghi/comments/commentRss/8536.htmlhttp://www.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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲男人天堂2018av| 久久亚洲av无码精品浪潮| 亚洲无砖砖区免费| 日韩精品人妻系列无码专区免费| 亚洲情XO亚洲色XO无码| a毛片免费在线观看| 亚洲国产AV无码专区亚洲AV| 可以免费观看的国产视频| 亚洲国产成人久久精品动漫| 91免费福利精品国产| 亚洲专区中文字幕| 大陆一级毛片免费视频观看i| 国产亚洲精品AAAA片APP| 亚洲Av无码乱码在线znlu| 一级**爱片免费视频| 亚洲国产日韩在线视频| 91高清免费国产自产拍2021| 亚洲欧洲精品久久| 日本高清免费aaaaa大片视频| 久久久久久亚洲av无码蜜芽| 亚洲国产精品一区二区九九| 中文在线免费观看| 亚洲最新在线视频| 国产成人高清精品免费软件| 国产精品免费在线播放| 亚洲经典在线中文字幕| 国产精品免费_区二区三区观看| 青青草97国产精品免费观看| 亚洲AV无码精品色午夜果冻不卡| 国产电影午夜成年免费视频 | 国产国产人免费人成免费视频| 18禁亚洲深夜福利人口| 亚洲精品视频在线看| 久久青草免费91观看| 亚洲欧美日韩一区二区三区在线| 亚洲爽爽一区二区三区| 亚洲毛片免费视频| 免费视频成人国产精品网站| 亚洲天天在线日亚洲洲精| 午夜成人免费视频| 日本视频免费高清一本18|