1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.context.ContextManager; 25 26 27 import org.apache.derby.iapi.sql.ResultSet; 28 import org.apache.derby.iapi.sql.execute.ConstantAction; 29 30 import org.apache.derby.iapi.sql.dictionary.DataDictionaryContext; 31 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 32 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor; 33 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator; 34 35 import org.apache.derby.iapi.sql.compile.CompilerContext; 36 import org.apache.derby.iapi.sql.conn.Authorizer; 37 38 import org.apache.derby.iapi.error.StandardException; 39 40 import org.apache.derby.iapi.services.monitor.Monitor; 41 import org.apache.derby.iapi.services.sanity.SanityManager; 42 43 import org.apache.derby.impl.sql.compile.ActivationClassBuilder; 44 import org.apache.derby.impl.sql.execute.BaseActivation; 45 46 import java.util.Properties ; 47 48 54 55 public class CreateSchemaNode extends DDLStatementNode 56 { 57 private String name; 58 private String aid; 59 60 68 public void init( 69 Object schemaName, 70 Object aid) 71 throws StandardException 72 { 73 78 initAndCheck(null); 79 80 this.name = (String ) schemaName; 81 this.aid = (String ) aid; 82 } 83 84 90 91 public String toString() 92 { 93 if (SanityManager.DEBUG) 94 { 95 return super.toString() + 96 "schemaName: " + "\n" + name + "\n" + 97 "authorizationId: " + "\n" + aid + "\n"; 98 } 99 else 100 { 101 return ""; 102 } 103 } 104 105 109 public QueryTreeNode bind() throws StandardException 110 { 111 super.bind(); 112 113 CompilerContext cc = getCompilerContext(); 114 if (isPrivilegeCollectionRequired()) 115 cc.addRequiredSchemaPriv(name, aid, Authorizer.CREATE_SCHEMA_PRIV); 116 117 return this; 118 } 119 120 public String statementToString() 121 { 122 return "CREATE SCHEMA"; 123 } 124 125 127 132 public ConstantAction makeConstantAction() 133 { 134 return getGenericConstantActionFactory().getCreateSchemaConstantAction(name, aid); 135 } 136 } 137 | Popular Tags |