⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libraryimpl.java

📁 简化的图书查询系统,服务器端和客户端都有。采用CORBA实现.
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -