1 24 25 package com.mckoi.database.interpret; 26 27 import com.mckoi.database.*; 28 import java.util.ArrayList ; 29 import java.util.List ; 30 31 38 39 public class Misc extends Statement { 40 41 44 boolean shutdown = false; 45 46 47 48 50 public void prepare() throws DatabaseException { 51 Object command = cmd.getObject("command"); 52 shutdown = command.equals("shutdown"); 53 } 54 55 public Table evaluate() throws DatabaseException { 56 57 DatabaseQueryContext context = new DatabaseQueryContext(database); 58 59 if (shutdown == true) { 61 62 if (!database.getDatabase().canUserShutDown(context, user)) { 64 throw new UserAccessException( 65 "User not permitted to shut down the database."); 66 } 67 68 database.getDatabase().startShutDownThread(); 70 71 return FunctionTable.resultTable(context, 0); 73 74 } 75 76 return FunctionTable.resultTable(context, 0); 77 } 78 79 80 } 81 | Popular Tags |