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

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

?? remoteindyserver.java~1~

?? 大量java源程序
?? JAVA~1~
字號:
/*
 * @(#)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一区二区三区免费野_久草精品视频
99久久精品国产麻豆演员表| 舔着乳尖日韩一区| 99精品热视频| 成人免费在线视频观看| 在线欧美日韩精品| 亚洲bt欧美bt精品| 日韩一区二区免费高清| 国产乱色国产精品免费视频| 国产色综合久久| 91麻豆国产自产在线观看| 亚洲在线视频网站| 日韩情涩欧美日韩视频| 粉嫩久久99精品久久久久久夜| 综合激情成人伊人| 欧美福利电影网| 国产成人精品一区二区三区四区| 亚洲欧美日韩在线播放| 91精品婷婷国产综合久久竹菊| 国产在线精品视频| 亚洲精品一卡二卡| 日韩精品综合一本久道在线视频| 国产经典欧美精品| 亚洲综合在线免费观看| 欧美一级片在线| 丁香婷婷深情五月亚洲| 一区二区高清视频在线观看| 精品国产一区二区在线观看| 99久久久国产精品| 看片的网站亚洲| 亚洲天堂成人在线观看| 日韩久久久精品| 91麻豆视频网站| 九九**精品视频免费播放| 亚洲女人小视频在线观看| 欧美va亚洲va香蕉在线| 日本丰满少妇一区二区三区| 免费成人结看片| 夜夜操天天操亚洲| 欧美激情一区二区三区| 日韩欧美一区中文| 欧美影院精品一区| 不卡一区中文字幕| 国产揄拍国内精品对白| 亚洲国产成人tv| 亚洲视频 欧洲视频| 久久久精品国产99久久精品芒果| 欧美日本国产一区| 色综合久久88色综合天天6| 国产在线精品免费av| 调教+趴+乳夹+国产+精品| 亚洲免费在线播放| 国产精品视频在线看| 亚洲天堂福利av| 久久午夜羞羞影院免费观看| 欧美老人xxxx18| 欧美伊人久久大香线蕉综合69 | 亚洲综合在线免费观看| 中文字幕电影一区| 精品处破学生在线二十三| 欧美日韩高清一区| 欧美性淫爽ww久久久久无| 91亚洲男人天堂| 成人av网站在线观看| 国产成人免费av在线| 国产精品综合二区| 国内一区二区视频| 国产一区二区美女诱惑| 久久国内精品视频| 日本不卡在线视频| 奇米影视7777精品一区二区| 亚洲第四色夜色| 亚洲成人动漫在线观看| 五月婷婷久久丁香| 奇米亚洲午夜久久精品| 热久久国产精品| 激情综合网最新| 国产精品456| 成人免费视频国产在线观看| 成人午夜免费电影| 97精品视频在线观看自产线路二| 99久久亚洲一区二区三区青草| 国产91精品精华液一区二区三区 | 日韩和的一区二区| 午夜欧美2019年伦理| 视频一区视频二区中文字幕| 免费观看30秒视频久久| 激情久久久久久久久久久久久久久久| 日韩国产精品91| 国内精品第一页| 大美女一区二区三区| 色综合视频在线观看| 欧美亚洲另类激情小说| 欧美一区二区三区四区在线观看 | 欧美日韩视频在线第一区| 在线播放中文一区| 精品日韩成人av| 国产精品久久久久aaaa樱花 | 欧美一区二区日韩一区二区| 91精品国产一区二区三区蜜臀| 日韩欧美亚洲国产精品字幕久久久| 欧美成人r级一区二区三区| 国产欧美精品一区aⅴ影院| 18欧美乱大交hd1984| 天天做天天摸天天爽国产一区| 黄色日韩三级电影| 99re这里都是精品| 欧美日韩一区二区欧美激情| 日韩女同互慰一区二区| 国产精品的网站| 国产.欧美.日韩| 在线一区二区三区四区五区| 日韩欧美成人一区| 国产精品激情偷乱一区二区∴| 亚洲国产日韩在线一区模特 | 日本va欧美va精品| 成人免费看片app下载| 欧美日韩小视频| 国产日韩在线不卡| 午夜一区二区三区视频| 国产精品77777| 在线综合+亚洲+欧美中文字幕| 国产亚洲精品超碰| 日韩成人伦理电影在线观看| 成人午夜精品在线| 91精品国产美女浴室洗澡无遮挡| 欧美国产精品一区| 另类专区欧美蜜桃臀第一页| 93久久精品日日躁夜夜躁欧美| 日韩一区二区在线观看视频 | 波多野结衣在线一区| 欧美日韩精品电影| 国产精品国产自产拍在线| 青青国产91久久久久久| 日本韩国精品在线| 国产精品国产三级国产专播品爱网| 蜜桃视频在线一区| 欧美日韩亚洲高清一区二区| 亚洲天堂免费看| 国产98色在线|日韩| 日韩欧美一区电影| 日韩精品一区第一页| 欧美在线免费观看亚洲| 国产精品久久网站| 丰满白嫩尤物一区二区| 久久亚洲精华国产精华液 | 国产精品99久久不卡二区| 欧美日韩欧美一区二区| 亚洲视频免费在线观看| 成人性生交大片免费看中文| 久久亚洲春色中文字幕久久久| 日本一区中文字幕| 欧美视频在线观看一区二区| 亚洲色图在线看| 99久久综合狠狠综合久久| 国产日韩精品一区二区三区| 国模娜娜一区二区三区| 欧美xingq一区二区| 毛片一区二区三区| 欧美xxxxx裸体时装秀| 久久国产日韩欧美精品| 精品国产一区二区三区不卡| 精品一区二区三区在线观看国产| 欧美放荡的少妇| 日本不卡在线视频| 精品少妇一区二区| 国产剧情在线观看一区二区| 精品久久一区二区| 国产精品一级黄| 国产拍揄自揄精品视频麻豆| 国产69精品久久久久毛片 | 国产亚洲精品久| 成人一区二区在线观看| 国产精品乱人伦一区二区| 97久久久精品综合88久久| 18欧美乱大交hd1984| 91福利资源站| 亚洲mv在线观看| 日韩一级免费观看| 国产在线国偷精品免费看| 亚洲国产成人在线| 91国在线观看| 国产99久久久国产精品| 国产精品国产精品国产专区不片| av爱爱亚洲一区| 亚洲成a天堂v人片| 日韩一区二区在线观看| 国产精品99久久久久久久女警| 国产精品麻豆久久久| 91国产福利在线| 日本成人在线一区| 久久久精品中文字幕麻豆发布| 成人一区在线观看| 亚洲成av人片一区二区| 精品成人佐山爱一区二区| 91最新地址在线播放| 偷拍亚洲欧洲综合| 欧美精品一区二区三区蜜桃视频| 成人激情文学综合网| 午夜激情久久久| 国产精品毛片大码女人|