1 20 25 package com.nilostep.xlsql.sql; 26 27 28 import com.nilostep.xlsql.sql.hsqldb.*; 29 import com.nilostep.xlsql.sql.mckoi.*; 30 import com.nilostep.xlsql.sql.mysql.*; 31 32 33 38 public class xlSqlFactory { 39 public static xlSql create(String type, com.nilostep.xlsql.database.xlDatabase database, String context) { 40 xlSql ret = null; 41 42 if (type.equals("hsqldb")) { 43 ret = new xlHsqldb(database); 44 } else if (type.equals("mckoi")) { 45 ret = new xlMcKoi(database, context); 46 } else if (type.equals("mysql")) { 47 ret = new xlMySQL(database, context); 48 } else { 49 throw new IllegalArgumentException (); 50 } 51 52 return ret; 53 } 54 } | Popular Tags |