libraryimpl.java

来自「简化的图书查询系统,服务器端和客户端都有。采用CORBA实现.」· Java 代码 · 共 49 行

JAVA
49
字号
import LibraryApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;
import java.io.*;
import java.util.Properties;

class LibraryImpl extends LibraryPOA {
  private ORB orb;

  public void setORB(ORB orb_val) {
    orb = orb_val; 
  }
    
    public String requery()
    {
      System.out.println("be in requery!");
      byte [] buff = new byte[1024];
      FileInputStream infile =null;
      try
      {
        infile = new FileInputStream("biao.txt");
         System.out.println("open txt file!!");
      }
      catch(FileNotFoundException e)
      {
          System.err.println("文件没找到");
      }
    
      try
       {
              
             int n = infile.read(buff);
             String str= new String(buff);
             infile.close();
             return str;
         }
         catch(Exception e)
         {
            return "Exception";
         }
     
   }
  public void shutdown() {
    orb.shutdown(false);
  }
} 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?