1 24 25 package org.objectweb.cjdbc.console.text.commands.sqlconsole; 26 27 import java.io.IOException ; 28 import java.sql.Connection ; 29 30 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 31 import org.objectweb.cjdbc.console.text.ConsoleException; 32 import org.objectweb.cjdbc.console.text.commands.ConsoleCommand; 33 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseConsole; 34 35 40 public class Commit extends ConsoleCommand 41 { 42 43 48 public Commit(VirtualDatabaseConsole module) 49 { 50 super(module); 51 } 52 53 56 public void parse(String commandText) throws IOException , ConsoleException 57 { 58 Connection connection = ((VirtualDatabaseConsole) module).getConnection(); 59 try 60 { 61 connection.commit(); 62 connection.setAutoCommit(true); 63 } 64 catch (Exception e) 65 { 66 console.printError(ConsoleTranslate.get("sql.display.exception", e), e); 67 } 68 } 69 70 73 public String getCommandName() 74 { 75 return "commit"; 76 } 77 78 81 public String getCommandDescription() 82 { 83 return ConsoleTranslate.get("sql.command.commit"); 84 } 85 } | Popular Tags |