KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nilostep > xlsql > sql > xlSqlWriterFactory


1 /*(Header: NiLOSTEP / xlSQL)
2
3  Copyright (C) 2004 NiLOSTEP
4    NiLOSTEP Information Sciences
5    http://nilostep.com
6    nilo.de.roock@nilostep.com
7
8  This program is free software; you can redistribute it and/or modify it under
9  the terms of the GNU General Public License as published by the Free Software
10  Foundation; either version 2 of the License, or (at your option) any later
11  version.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16  more details. You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software Foundation,
18  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */

20 /*
21  * xlDatabaseFactory.java
22  *
23  * Created on 9 augustus 2004, 18:18
24  */

25 package com.nilostep.xlsql.sql;
26
27 import com.nilostep.xlsql.sql.hsqldb.*;
28 import com.nilostep.xlsql.sql.mckoi.*;
29 import com.nilostep.xlsql.sql.mysql.*;
30
31 import java.sql.*;
32
33
34 /**
35  * DOCUMENT ME!
36  *
37  * @author Jim Caprioli
38  */

39 public class xlSqlWriterFactory {
40     /**
41      * DOCUMENT ME!
42      *
43      * @param type DOCUMENT ME!
44      *
45      * @return DOCUMENT ME!
46      */

47     public static xlSqlWriter create(String JavaDoc type) {
48         xlSqlWriter ret = null;
49
50         if (type.equals("hsqldb")) {
51             ret = new xlHsqldbWriter();
52         } else if (type.equals("mckoi")) {
53             ret = new xlMcKoiWriter();
54         } else if (type.equals("mysql")) {
55             ret = new xlMySQLWriter();
56         } else {
57             throw new IllegalArgumentException JavaDoc();
58         }
59
60         return ret;
61     }
62 }
Popular Tags