1 24 25 package org.objectweb.cjdbc.controller.backend; 26 27 import org.objectweb.cjdbc.common.xml.DatabasesXmlTags; 28 29 34 public abstract class DatabaseBackendSchemaConstants 35 { 36 37 public static final int DynamicPrecisionStatic = 0; 38 39 public static final int DynamicPrecisionTable = 1; 40 41 public static final int DynamicPrecisionColumn = 2; 42 43 public static final int DynamicPrecisionProcedures = 3; 44 45 public static final int DynamicPrecisionAll = 4; 46 47 53 public static int getDynamicSchemaLevel(String stringLevel) 54 { 55 if (stringLevel.equalsIgnoreCase(DatabasesXmlTags.VAL_static)) 56 return DynamicPrecisionStatic; 57 else if (stringLevel.equalsIgnoreCase(DatabasesXmlTags.VAL_table)) 58 return DynamicPrecisionTable; 59 else if (stringLevel.equalsIgnoreCase(DatabasesXmlTags.VAL_column)) 60 return DynamicPrecisionColumn; 61 else if (stringLevel.equalsIgnoreCase(DatabasesXmlTags.VAL_procedures)) 62 return DynamicPrecisionProcedures; 63 else if (stringLevel.equalsIgnoreCase(DatabasesXmlTags.VAL_all)) 64 return DynamicPrecisionAll; 65 else 66 throw new IllegalArgumentException ("Invalid dynamic precision " 67 + stringLevel); 68 } 69 70 76 public static String getDynamicSchemaLevel(int intLevel) 77 { 78 switch (intLevel) 79 { 80 case DynamicPrecisionStatic : 81 return DatabasesXmlTags.VAL_static; 82 case DynamicPrecisionTable : 83 return DatabasesXmlTags.VAL_table; 84 case DynamicPrecisionColumn : 85 return DatabasesXmlTags.VAL_column; 86 case DynamicPrecisionProcedures : 87 return DatabasesXmlTags.VAL_procedures; 88 case DynamicPrecisionAll : 89 return DatabasesXmlTags.VAL_all; 90 default : 91 return DatabasesXmlTags.VAL_all; 92 } 93 } 94 } | Popular Tags |