1 24 25 package org.objectweb.cjdbc.console.text.commands.sqlconsole; 26 27 import java.io.IOException ; 28 29 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 30 import org.objectweb.cjdbc.console.text.ConsoleException; 31 import org.objectweb.cjdbc.console.text.commands.ConsoleCommand; 32 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseConsole; 33 34 39 public class SetFetchSize extends ConsoleCommand 40 { 41 42 47 public SetFetchSize(VirtualDatabaseConsole module) 48 { 49 super(module); 50 } 51 52 55 public void parse(String commandText) throws IOException , ConsoleException 56 { 57 try 58 { 59 int fetchsize = new Integer (commandText.trim()).intValue(); 60 ((VirtualDatabaseConsole)module).setFetchsize(fetchsize); 61 console.println(ConsoleTranslate.get("sql.command.fetchsize.value", 62 fetchsize)); 63 } 64 catch (NumberFormatException e) 65 { 66 console.printError(getUsage()); 67 } 68 } 69 70 73 public String getCommandName() 74 { 75 return "fetchsize"; 76 } 77 78 81 public String getCommandParameters() 82 { 83 return ConsoleTranslate.get("sql.command.fetchsize.params"); 84 } 85 86 89 public String getCommandDescription() 90 { 91 return ConsoleTranslate.get("sql.command.fetchsize.description"); 92 } 93 } | Popular Tags |