1 30 31 32 package org.hsqldb.test; 33 34 import java.io.IOException ; 35 import java.net.ServerSocket ; 36 import java.net.Socket ; 37 import java.sql.SQLException ; 38 39 import org.hsqldb.HsqlServerFactory; 40 import org.hsqldb.HsqlSocketRequestHandler; 41 42 50 public class TestInstantiation { 51 52 public TestInstantiation() { 53 54 try { 55 ServerSocket serversocket; 56 Socket socket; 57 String m_DatabaseName; 58 HsqlSocketRequestHandler m_hsrh; 59 60 m_DatabaseName = "mem:."; 61 serversocket = new ServerSocket (9999); 62 63 while (true) { 64 socket = serversocket.accept(); 65 m_hsrh = HsqlServerFactory.createHsqlServer(m_DatabaseName, 66 true, false); 67 68 m_hsrh.handleConnection(socket); 69 } 70 } catch (IOException e1) { 71 System.out.println(e1.getMessage()); 72 } catch (SQLException e2) { 73 System.out.println(e2.getMessage()); 74 } 75 } 76 77 public static void main(String [] argv) { 78 new TestInstantiation(); 79 } 80 } 81 | Popular Tags |