1 21 22 package org.apache.derby.iapi.jdbc; 23 24 import org.apache.derby.iapi.reference.Property; 25 import org.apache.derby.iapi.reference.MessageId; 26 import org.apache.derby.iapi.jdbc.AuthenticationService; 27 import org.apache.derby.iapi.error.StandardException; 28 import org.apache.derby.iapi.services.property.PropertyUtil; 29 import org.apache.derby.iapi.services.monitor.Monitor; 30 31 import java.util.Properties ; 32 import java.io.PrintStream ; 33 34 39 public class JDBCBoot { 40 41 private Properties bootProperties; 42 43 private static final String NETWORK_SERVER_AUTOSTART_CLASS_NAME = "org.apache.derby.iapi.jdbc.DRDAServerStarter"; 44 45 public JDBCBoot() { 46 bootProperties = new Properties (); 47 } 48 49 void addProperty(String name, String value) { 50 bootProperties.put(name, value); 51 } 52 53 58 public void boot(String protocol, PrintStream logging) { 59 60 if (org.apache.derby.jdbc.InternalDriver.activeDriver() == null) 61 { 62 63 addProperty("derby.service.jdbc", "org.apache.derby.jdbc.InternalDriver"); 67 addProperty("derby.service.authentication", AuthenticationService.MODULE); 68 69 Monitor.startMonitor(bootProperties, logging); 70 71 78 if( Boolean.valueOf(PropertyUtil.getSystemProperty(Property.START_DRDA)).booleanValue()) 79 { 80 try 81 { 82 Monitor.startSystemModule( NETWORK_SERVER_AUTOSTART_CLASS_NAME); 83 } 84 catch( StandardException se) 85 { 86 Monitor.logTextMessage( MessageId.CONN_NETWORK_SERVER_START_EXCEPTION, 87 se.getMessage()); 88 } 89 } 90 } 91 } 92 } 93 | Popular Tags |