亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? remoteindyserver.java~2~

?? 大量java源程序
?? JAVA~2~
字號:
/*
 * @(#)RemoteIndyServer
 *
 * Copyright (c) 1998 Karl Moss. All Rights Reserved.
 *
 * You may study, use, modify, and distribute this software for any
 * purpose provided that this copyright notice appears in all copies.
 *
 * This software is provided WITHOUT WARRANTY either expressed or
 * implied.
 *
 * @author  Karl Moss
 * @version 1.0
 * @date    17Apr98
 *
 */

package javaservlets.tunnel;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import javaservlets.tunnel.server.*;
import javaservlets.db.*;
import javaservlets.jdbc.*;
import javaservlets.timer.*;
import java.util.List;
import java.util.ArrayList;



/**
  * <p>This class implements the server for tunneling
  * remote Indy method calls
  */

public class RemoteIndyServer
  extends TunnelServer
{   List array=new ArrayList();

  /**
    * <p>Creates a new instance of the server object.
    *
    * @return Instance of the server object
    */



  public Object _getNewInstance()
    throws ServletException
    {
      return new Indy();
    }

  /**
    * <p>Invokes the method for the ordinal given. If the method
    * throws an exception it will be sent to the client.
    *
    * @param Object Server object
    * @param ordinal Method ordinal
    * @param in Input stream to read additional parameters
    * @param out Output stream to write return values
    */




  public void _invokeMethod(Object serverObject, int ordinal,
                            DataInput in, DataOutput out)
    throws Exception
    {   // The JDBC Connection object
      Connection con = null;

      // The JDBC Statement object
      Statement stmt = null;
      ServletConfig config = getServletConfig();
      ServletContext context = config.getServletContext();
      Object o = context.getAttribute(ConnectionServlet_21.KEY);
      if (o == null) {
        throw new ServletException("ConnectionServlet not started");
      }
      ConnectionServlet_21 conServlet = (ConnectionServlet_21) o;

      // Cast the server object
      Indy indy = (Indy) serverObject;

      // Cast the input/output streams
      ObjectInputStream objectIn = (ObjectInputStream) in;
      ObjectOutputStream objectOut = (ObjectOutputStream) out;

      // Evaluate the ordinal
      switch (ordinal) {
      case 0: // connect
        System.out.println("case 0");
        boolean b0 = indy.connect();
        objectOut.writeObject(new Boolean(b0));
        break;

      case 1: // close
        System.out.println("case 1");
        indy.close();
        break;

      case 2: // query
        System.out.println("case 2");
       //////////////////////////////////////////////////
       // Integer i2 = (Integer) objectIn.readObject();
       // There are problems!!!!
        IndyRecord record[] = indy.query();
        System.out.println("at RemoteIndyServer:"+record[0].taskID);
        objectOut.writeObject(record);
        break;
       case 3: // delete
        System.out.println("case 3");
        String s = (String) objectIn.readObject();
        System.out.println("I want to delete:  "+s);
        indy.delete(s);
        break;
       case 4: // insert
        System.out.println("case 4");
     IndyRecord records = (IndyRecord)objectIn.readObject();

        System.out.println("I want to insert: "+records.taskID);
        indy.insert(records);
        break;
       case 5: // update
        System.out.println("case 5");
     IndyRecord re = (IndyRecord)objectIn.readObject();

        System.out.println("I want to update: "+re.taskID);
          indy.update(re);

        break;
 ////////////////////////////////////////////////////////////
      // Get the ConnectionServlet that holds the
      // connection pool
   case 6://schedule
    List list=new ArrayList();
    String[] output=new String[50];

          try {

        // Get an available connection from our connection pool
        con = conServlet.getConnection();
 /////////////////////////////////////////////////////////////
         try
        {
         array.clear();
        }
        catch(UnsupportedOperationException exc)
        {  System.out.println("can't clear the list!!!");
        }
       record[] res=find();
        insert(res);

        while(!array.isEmpty())
        {  String id=((record)array.get(0)).taskID;
           String nextid[]=((record)array.get(0)).nextID;
           list.add(id);
           delete(nextid);
           array.remove(0);
           find();
        }
   System.out.println("toop include: ");

      for(int i=0;i<list.size();i++)
      {    System.out.println((String)list.get(i));
           output[i]=(String)list.get(i);
      }
       String query="update toop set isnew=true,newdu=0";
       stmt=con.createStatement();
       stmt.executeUpdate(query);

      }
      catch (Exception ex) {
      }
      finally {
        try {
          // Always close properly

          if (stmt != null) {
            stmt.close();
          }
          if (con != null) {
            // Put the connection back into the pool
            conServlet.close(con);
          }
        }
        catch (Exception ex) {
          // Ignore any errors here
        }
      }
    if(output.length!=0)
     objectOut.writeObject(output);

   break;
 /////////////////////////////////////////////////////////////
      default:
        throw new Exception("Invalid ordinal: " + ordinal);
      }
    }

  private record[] find()
   {   record[] re;
         List rec=new ArrayList();
        int locate=-1;
      // The JDBC Connection object
      Connection con = null;
      Connection con1=null;
      // The JDBC Statement object
      Statement stmt = null;
      Statement stmt1=null;
      ServletConfig config = getServletConfig();
      ServletContext context = config.getServletContext();
      Object o = context.getAttribute(ConnectionServlet_21.KEY);
      if (o == null) {
        //throw new ServletException("ConnectionServlet not started");
      }
      ConnectionServlet_21 conServlet = (ConnectionServlet_21) o;

      // The JDBC ResultSet object
      ResultSet rs = null;
     try {
        // Get an available connection from our connection pool
        con = conServlet.getConnection();
        con1=conServlet.getConnection();
        // Create a statement object that we can execute queries
        // with
       stmt = con.createStatement();
       stmt1=con1.createStatement();
       String query1="select taskID,nextID from toop where indu=newdu and isnew=true";
         rs=stmt.executeQuery(query1);
         while(rs.next())
         {
           String a=rs.getString(1);
           String b=rs.getString(2);
           System.out.println("in find( ) "+a);
           System.out.println("in find( ) "+b);
           boolean isinsert=false;
           for(int i=0;i<rec.size();i++)
             {if(a==((record)rec.get(i)).taskID)
                 {isinsert=true;
                   locate=i;
                 }
             }
             if(isinsert)
             {  //int l=(((record)rec.get(locate)).nextID).length;
                //((record)rec.get(locate)).nextID[l]=b;
              System.out.println("I come here2 ");
              }
              else
              {     record c=new record();
                     c.taskID=a;
                     c.nextID[0]=b;
                     rec.add(c);
                 System.out.println("I come here3 ");
                }
          }
            System.out.println("I come here4 ");
           String query2="update toop set isnew=false where taskID in"+
           "(select taskID from toop where indu=newdu and isnew=true)";
        System.out.print("execute query2");
          stmt1.executeUpdate(query2);

      }
      catch (Exception ex)
      { System.out.println("I come here5 ");

      System.out.println("find() mathod error: "+ex.toString());
      }
      finally {
        try {
          // Always close properly
          if (rs != null) {
            rs.close();
          }
          if (stmt != null) {
            stmt.close();
          }
          if(stmt1!=null)
          {stmt1.close();}
          if (con != null) {
            // Put the connection back into the pool
            conServlet.close(con);
          }
         if (con1!= null) {
            // Put the connection back into the pool
            conServlet.close(con1);
          }
        }
        catch (Exception ex) {
          // Ignore any errors here
        }
      }
       record copy[]=new record[rec.size()];
       for(int i=0;i<rec.size();i++)
       { copy[i]=(record)rec.get(i); }
       re=copy;
   return re;
   }

 ////////////////////////////////////////////////////////////////
 private void insert(record[] re)
 {   for(int i=0;i<re.length;i++)
     { array.add(re[i]);
     }
 }
////////////////////////////////////////////////////////////////
 private void delete(String[] nextid)
 {   // The JDBC Connection object
      Connection con = null;
      ServletConfig config = getServletConfig();
      ServletContext context = config.getServletContext();
      Object o = context.getAttribute(ConnectionServlet_21.KEY);
      if (o == null) {
        //throw new ServletException("ConnectionServlet not started");
      }
      ConnectionServlet_21 conServlet = (ConnectionServlet_21) o;

      // The JDBC Statement object
       PreparedStatement stmt = null;
     try {
        // Get an available connection from our connection pool
        con = conServlet.getConnection();

        // Create a statement object that we can execute queries
        // with
        try {String query="update toop set newdu=newdu+1 "+
                           "where taskID=?";

         stmt = con.prepareStatement(query );
         for(int i=0;i<nextid.length;i++)
          {  stmt.setString(1,nextid[i]);
             stmt.executeUpdate();
          }
            }
      catch (SQLException ex) {
        ex.printStackTrace();
      }
      }
      catch (Exception ex)
      {
      System.out.println("delete() mathod error: "+ex.toString());
      }
      finally {
        try {
          // Always close properly
          if (stmt != null) {
            stmt.close();
          }
          if (con != null) {
            // Put the connection back into the pool
            conServlet.close(con);
          }
        }
        catch (Exception ex) {
          // Ignore any errors here
        }
      }
 }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区免费视频| av中文字幕在线不卡| 国内偷窥港台综合视频在线播放| 国产一区日韩二区欧美三区| 久久se精品一区二区| eeuss鲁一区二区三区| 欧美日韩一区二区三区四区五区| 欧美成人免费网站| 亚洲乱码中文字幕综合| 国模套图日韩精品一区二区| av不卡免费在线观看| 99国产精品国产精品毛片| 日韩激情一区二区| 91视视频在线观看入口直接观看www | 国产成人8x视频一区二区| 欧美亚洲一区三区| 国产精品福利一区二区| 国产美女视频一区| 日韩午夜小视频| 午夜国产不卡在线观看视频| 色综合天天视频在线观看| 国产日韩欧美综合在线| 久久国产乱子精品免费女| 欧美一区二区三区视频在线 | 国产精品网站一区| 国产东北露脸精品视频| 精品va天堂亚洲国产| 久久精品国产亚洲一区二区三区| 欧美美女黄视频| 视频一区在线视频| 欧美一区永久视频免费观看| 午夜免费久久看| 欧美一激情一区二区三区| 日韩高清国产一区在线| 日韩一区二区电影在线| 青娱乐精品视频| 精品久久五月天| 国产乱码精品一区二区三区五月婷 | 色婷婷久久久综合中文字幕| 综合电影一区二区三区| 日本久久一区二区| 亚洲国产精品久久久男人的天堂 | 五月天欧美精品| 精品三级在线观看| 国产成人h网站| 成人欧美一区二区三区白人| 91极品美女在线| 免费久久99精品国产| 日韩精品一区二区三区蜜臀 | 欧美性猛交一区二区三区精品| 亚洲午夜免费电影| 91精品国产综合久久福利 | 国产日韩欧美a| 色综合久久综合网97色综合 | 国产成人精品三级麻豆| 亚洲天天做日日做天天谢日日欢| 欧美三级电影一区| 久久超碰97人人做人人爱| 国产精品丝袜在线| 在线免费观看成人短视频| 日本女人一区二区三区| 欧美国产成人精品| 欧美人体做爰大胆视频| 国内精品视频666| 一区二区三区精品| 久久青草欧美一区二区三区| 色婷婷久久久综合中文字幕| 久久99最新地址| 亚洲精选视频免费看| 26uuu亚洲| 欧美日韩一卡二卡三卡| 成人国产亚洲欧美成人综合网| 丝袜美腿亚洲色图| 国产精品久久久久久久午夜片| 欧洲一区二区三区在线| 国产精品888| 秋霞成人午夜伦在线观看| 中文字幕一区二区三区不卡在线| 欧美一区国产二区| 色欲综合视频天天天| 国产成人小视频| 日本亚洲电影天堂| 夜夜嗨av一区二区三区中文字幕| 久久久国产精华| 日韩一区二区三区在线观看| 99re成人在线| 国产成都精品91一区二区三| 日本不卡一二三| 亚洲一区二区在线观看视频| 中文字幕二三区不卡| 久久综合久久99| 在线不卡欧美精品一区二区三区| 成人av资源下载| 国精产品一区一区三区mba视频| 一区二区欧美国产| 亚洲三级久久久| 国产日韩欧美综合一区| 欧美v亚洲v综合ⅴ国产v| 欧美日韩国产一区| 欧美色网站导航| 色八戒一区二区三区| 99久免费精品视频在线观看| 成人看片黄a免费看在线| 国产精品一卡二| 国产一区二区三区综合| 激情综合色丁香一区二区| 热久久国产精品| 蜜桃视频第一区免费观看| 亚洲va国产va欧美va观看| 亚洲国产sm捆绑调教视频| 亚洲一区二区综合| 亚洲超丰满肉感bbw| 婷婷丁香久久五月婷婷| 五月婷婷激情综合| 天堂一区二区在线| 日韩av一区二| 国产一区视频网站| 国产精品羞羞答答xxdd| 福利电影一区二区| 不卡的电视剧免费网站有什么| 成人午夜精品一区二区三区| 丁香桃色午夜亚洲一区二区三区| 国产成人精品影院| 99久久久精品| 欧美日韩中文精品| 欧美一区二区精品久久911| 91精品国产乱码久久蜜臀| 欧美一区二区大片| 久久亚洲免费视频| 国产精品久久久爽爽爽麻豆色哟哟 | 成人开心网精品视频| 色综合天天在线| 欧美日韩亚洲国产综合| 欧美一区三区四区| 国产视频一区在线播放| 亚洲乱码中文字幕综合| 日韩国产一二三区| 国产精品夜夜嗨| 在线免费观看日本欧美| 日韩一卡二卡三卡四卡| 国产三级精品三级在线专区| 亚洲黄网站在线观看| 麻豆久久久久久| 99免费精品在线观看| 制服.丝袜.亚洲.另类.中文 | 日韩欧美综合一区| 国产精品美女久久久久aⅴ | 亚洲品质自拍视频| 日韩在线观看一区二区| 国产一区欧美二区| 一本一道久久a久久精品综合蜜臀| 在线播放日韩导航| 国产精品亲子乱子伦xxxx裸| 亚洲国产精品久久久久婷婷884 | 久久久久久麻豆| 一区二区三区中文免费| 国产一区欧美二区| 欧美日韩精品电影| 欧美高清在线一区| 蜜桃精品视频在线观看| 91色在线porny| 亚洲精品一区二区三区福利| 亚洲精品免费在线| 国产一区二区0| 欧美丰满美乳xxx高潮www| 国产精品久久久久久亚洲毛片| 日韩电影网1区2区| 色综合久久久久综合体桃花网| 久久在线观看免费| 五月天网站亚洲| 91在线云播放| 中文字幕乱码久久午夜不卡| 五月婷婷另类国产| 日本乱人伦一区| 亚洲日本中文字幕区| 国产成人免费xxxxxxxx| 欧美成人一级视频| 丝袜脚交一区二区| 欧美日韩日本视频| 亚洲无线码一区二区三区| 99久久er热在这里只有精品15| 久久午夜电影网| 蜜臀久久久久久久| 91精品久久久久久久99蜜桃| 亚洲图片欧美视频| 色综合色狠狠天天综合色| 国产精品乱码妇女bbbb| 国产乱子伦一区二区三区国色天香| 欧美一区二区福利视频| 日日摸夜夜添夜夜添国产精品| 欧美专区在线观看一区| 亚洲美女视频在线观看| 色综合天天综合狠狠| 亚洲另类色综合网站| 91九色最新地址| 亚洲综合色自拍一区| 欧洲av在线精品| 亚洲成人先锋电影| 欧美日本韩国一区二区三区视频| 亚洲超碰精品一区二区|