From: zapata Date: Fri, 27 Jun 2003 02:43:41 +0000 (+0000) Subject: removed the hardly used adaptor stuff. improved config checking on servlet initialization X-Git-Tag: LATEST_MERGED_1_1~341 X-Git-Url: http://erislabs.net/gitweb/?p=mir.git;a=commitdiff_plain;h=9cd7f391766bfef4ae48f1307e093754187bcdc1 removed the hardly used adaptor stuff. improved config checking on servlet initialization --- diff --git a/NEWS b/NEWS index dfcd4535..0e5e9126 100755 --- a/NEWS +++ b/NEWS @@ -1,8 +1,8 @@ -[last changed: $Date: 2002/12/24 01:52:41 $] 2002 mir-coders group +[last changed: $Date: 2003/06/27 02:43:41 $] 2002 mir-coders group ------------------------------------------------------------------------------- ================================ -1.1(HEAD) (as of yet unreleased) +1.1 (as of yet unreleased) ================================ [New features/Improvements] diff --git a/doc/KNOWN_BUGS b/doc/KNOWN_BUGS index 05b51063..32ef7297 100755 --- a/doc/KNOWN_BUGS +++ b/doc/KNOWN_BUGS @@ -1,4 +1,4 @@ -last changed: $Date: 2002/12/23 02:54:40 $ 2002 mir-coders +last changed: $Date: 2003/06/27 02:43:42 $ 2002 mir-coders ------------------------------------------------------------------- In all versions @@ -8,11 +8,17 @@ In all versions thumbnail for a GIF or PNG image look like it has some television set snow in it. The workaround would be to upload Jpeg images if you can. We are looking into replacing JAI with another library. + Zapata: I fixed this (hopefully) + * when deleting an item, be it an article or an uploaded media file, the action will remove the data/meta-data from the DB and prevent it from show up in lists, but it will not delete the file from the filesystem. hopefully this will be fixed before 1.1.0 is released and in 1.0.1. (FIXME: is this still a problem in the HEAD branch?) + Zapata: Deleting objects makes them untraceable and is thus generally a bad + idea. It can be so configured (using producers.xml) that hidden stuff (articles, + media) are deleted + * some obscure "under certain conditions" corner cases listed in our bug tracker at https://prod.indymedia.nl/mantis * some others that I'm forgetting now. diff --git a/doc/mission.html b/doc/mission.html index c7e68f02..c2b79561 100755 --- a/doc/mission.html +++ b/doc/mission.html @@ -1 +1 @@ -

mir developer mission statement


build creative free software that allows people to share and access content in an accesible way that promotes participation and is insensitive to repression, focussing to the needs of progressive grassroots organization.

mir key features:

\ No newline at end of file +

mir developer mission statement


build creative free software that allows people to share and access content in an accesible way that promotes participation and is insensitive to repression, focussing to the needs of progressive grassroots organization.

mir key features:

\ No newline at end of file diff --git a/source/default.properties b/source/default.properties index 2cc68835..98caf592 100755 --- a/source/default.properties +++ b/source/default.properties @@ -361,18 +361,9 @@ Database.Username=postgres Database.Password= Database.Host=localhost Database.Name=Mir +Database.Port=5432 +Database.Driver=org.postgresql.Driver -# -# this sets the adaptor to be used - -Database.Adaptor=mir.storage.DatabaseAdaptorPostgresql - -# -# configuration for adaptor postgres -# In this example, "Mir" is the dbname - -Adaptor.PostgreSQL.URL=jdbc:postgresql://localhost:5432/Mir -Adaptor.PostgreSQL.Driver=org.postgresql.Driver # # Servlet / Module configurations diff --git a/source/mir/servlet/AbstractServlet.java b/source/mir/servlet/AbstractServlet.java index 67c634a0..93c7b413 100755 --- a/source/mir/servlet/AbstractServlet.java +++ b/source/mir/servlet/AbstractServlet.java @@ -33,6 +33,7 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Locale; +import java.sql.*; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -41,22 +42,23 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import mir.config.MirPropertiesConfiguration; -import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; -import mir.log.LoggerWrapper; -import mir.storage.DatabaseAdaptor; -import com.codestudio.util.JDBCPool; +import com.codestudio.util.*; import com.codestudio.util.JDBCPoolMetaData; import com.codestudio.util.SQLManager; +import mir.config.MirPropertiesConfiguration; +import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; +import mir.log.LoggerWrapper; +import mircoders.global.*; + /** * Title: Mir * Description: Abstract servlet-class * Copyright: Copyright (c) 2001, 2002 * Company: Mir-coders group * @author idfx, the Mir-coders group - * @version $Id: AbstractServlet.java,v 1.30.2.1 2003/06/13 03:54:08 zapata Exp $ + * @version $Id: AbstractServlet.java,v 1.30.2.2 2003/06/27 02:43:42 zapata Exp $ */ public abstract class AbstractServlet extends HttpServlet { @@ -147,34 +149,29 @@ public abstract class AbstractServlet extends HttpServlet { try { configuration = MirPropertiesConfiguration.instance(); } - catch (PropertiesConfigExc e) { - throw new ServletException(e); + catch (Throwable t) { + logger.fatal("can't read configuration: " + t.toString()); + throw new ServletException("can't read configuration: " + t.toString()); + } + + try { + MirGlobal.localizer(); + } + catch (Throwable t) { + logger.fatal("can't get localizer: " + t.toString()); + throw new ServletException("can't get localizer: " + t.toString()); } String dbUser = configuration.getString("Database.Username"); String dbPassword = configuration.getString("Database.Password"); String dbHost = configuration.getString("Database.Host"); + String dbPort = configuration.getString("Database.Port"); String dbAdapName = configuration.getString("Database.Adaptor"); String dbName = configuration.getString("Database.Name"); - - DatabaseAdaptor adaptor; - try { - adaptor = (DatabaseAdaptor) Class.forName(dbAdapName).newInstance(); - } - catch (Exception e) { - throw new ServletException("Could not load DB adapator: " + - e.toString()); - } - - String dbDriver; - String dbUrl; - try { - dbDriver = adaptor.getDriver(); - dbUrl = adaptor.getURL(dbUser, dbPassword, dbHost); - } - catch (Exception e) { - throw new ServletException(e); - } + String dbDriver = configuration.getString("Database.Driver"); + String dbUrl = "jdbc:postgresql://"+dbHost+":"+dbPort+"/"+dbName; + int dbMin = configuration.getInteger("Database.poolMin", 1); + int dbMax = configuration.getInteger("Database.poolMax", 10); JDBCPoolMetaData meta = new JDBCPoolMetaData(); meta.setDbname(dbName); @@ -183,19 +180,29 @@ public abstract class AbstractServlet extends HttpServlet { meta.setUserName(dbUser); meta.setPassword(dbPassword); meta.setJNDIName("mir"); - meta.setMaximumSize(10); - meta.setMinimumSize(1); + meta.setMaximumSize(dbMax); + meta.setMinimumSize(dbMin); meta.setPoolPreparedStatements(false); meta.setCacheEnabled(false); meta.setCacheSize(15); meta.setDebugging(false); -// meta.setLogFile(dblogfile+".pool"); SQLManager manager = SQLManager.getInstance(); + JDBCPool pool = null; if (manager != null) { pool = manager.createPool(meta); } + + Connection connection; + try { + connection = pool.requestConnection(); + pool.closeConnection(connection); + } + catch (Throwable t) { + logger.fatal("Can't connect to database: " + t.toString()); + throw new ServletException("Can't connect to database: " + t.toString()); + } } private void setEncoding(HttpServletRequest request){ diff --git a/source/mir/storage/Database.java b/source/mir/storage/Database.java index 7a3034ea..95be6616 100755 --- a/source/mir/storage/Database.java +++ b/source/mir/storage/Database.java @@ -76,7 +76,7 @@ import mir.util.JDBCStringRoutines; * Treiber, Host, User und Passwort, ueber den der Zugriff auf die * Datenbank erfolgt. * - * @version $Id: Database.java,v 1.44.2.4 2003/06/23 15:24:06 zapata Exp $ + * @version $Id: Database.java,v 1.44.2.5 2003/06/27 02:43:42 zapata Exp $ * @author rk * */ @@ -116,7 +116,7 @@ public class Database implements StorageObject { private String database_driver; private String database_url; private int defaultLimit; - protected DatabaseAdaptor theAdaptor; + TimeZone timezone; SimpleDateFormat internalDateFormat; SimpleDateFormat userInputDateFormat; @@ -158,7 +158,6 @@ public class Database implements StorageObject { try { theEntityClass = GENERIC_ENTITY_CLASS; - theAdaptor = (DatabaseAdaptor) Class.forName(theAdaptorName).newInstance(); } catch (Throwable e) { logger.error("Error in Database() constructor with " + theAdaptorName + " -- " + e.getMessage()); @@ -595,10 +594,8 @@ public class Database implements StorageObject { selectSql.append(" order by ").append(anOrderByClause); } - if (theAdaptor.hasLimit()) { - if ((limit > -1) && (offset > -1)) { - selectSql.append(" LIMIT ").append(limit).append(" OFFSET ").append(offset); - } + if ((limit > -1) && (offset > -1)) { + selectSql.append(" LIMIT ").append(limit).append(" OFFSET ").append(offset); } // execute sql @@ -628,9 +625,7 @@ public class Database implements StorageObject { } // making entitylist infos - if (!(theAdaptor.hasLimit())) { - count = offsetCount; - } + count = offsetCount; if (theReturnList != null) { // now we decide if we have to know an overall count... @@ -870,7 +865,7 @@ public class Database implements StorageObject { return null; } - pstmt = con.prepareStatement(theAdaptor.getLastInsertSQL(this)); + pstmt = con.prepareStatement("select currval('" + getCoreTable() + "_id_seq')"); ResultSet rs = pstmt.executeQuery(); rs.next(); diff --git a/source/mir/storage/DatabaseAdaptor.java b/source/mir/storage/DatabaseAdaptor.java deleted file mode 100755 index 65874ca4..00000000 --- a/source/mir/storage/DatabaseAdaptor.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2001, 2002 The Mir-coders group - * - * This file is part of Mir. - * - * Mir is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Mir is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Mir; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), - * and distribute linked combinations including the two. You must obey the - * GNU General Public License in all respects for all of the code used other than - * the above mentioned libraries. If you modify this file, you may extend this - * exception to your version of the file, but you are not obligated to do so. - * If you do not wish to do so, delete this exception statement from your version. - */ -package mir.storage; - -import java.util.Properties; - -import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; - - -/** - * Interfacedefinition f?r Datenbank-Adpatoren. Die Adaptoren legen - * jeweils das Verhalten und die Befehlsm?chtigkeit der Datenbank - * fest. - * - * @author - * - * @version $Id: DatabaseAdaptor.java,v 1.7 2003/04/21 12:42:47 idfx Exp $ - */ -public interface DatabaseAdaptor { - /* Liefert den Namen der Adaptorklasse - * @return Adaptorklasse als String - */ - public abstract String getDriver() throws PropertiesConfigExc; - - /** - * Liefert die URL f?r JDBC zur?ck, in den die Parameter user, pass und host - * eingef?gt werden. Die URL wird aus der Konfiguration geholt. - * - * @param user user als String - * @param pass passwort als String - * @param host host als String - * @return url als String - */ - public abstract String getURL(String user, String pass, String host) - throws PropertiesConfigExc; - - /** - * Gibt zur?ck, ob das SQL der Datenbank den limit-Befehl beherrscht. - * @return true wenn ja, sonst false - */ - public abstract boolean hasLimit(); - - /** - * Liefert zur?ck, ob der limit-Befehl erst start und dann offset - * hat (true), oder umgekehrt. Nur Relevant, wenn hasLimit true zur?ckliefert. - * - * @return true wenn erstes, sonst false - */ - public abstract boolean reverseLimit(); - - /** - * Liefert ein Properties-Objekt zurueck mit user und password. - * @param user - * @param password - * @return Properties - */ - public abstract Properties getProperties(String user, String password); - - /** - * Gibt SQL-Stringfragment zur?ck, mit dem nach einem insert-Befehl ermittelt - * werden kann, wie man den primary-Key des eingef?gten Datensatzes bekommt. - * - * @param theDB Database-Objekt, aus dem ggf. noetige Informationen geholt - * werden k?nnen, wie z.B. der Tabellenname - * @return SQL-Statement als String - */ - public abstract String getLastInsertSQL(Database theDB); -} diff --git a/source/mir/storage/DatabaseAdaptorMySQL.java b/source/mir/storage/DatabaseAdaptorMySQL.java deleted file mode 100755 index 00970d99..00000000 --- a/source/mir/storage/DatabaseAdaptorMySQL.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2001, 2002 The Mir-coders group - * - * This file is part of Mir. - * - * Mir is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Mir is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Mir; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), - * and distribute linked combinations including the two. You must obey the - * GNU General Public License in all respects for all of the code used other than - * the above mentioned libraries. If you modify this file, you may extend this - * exception to your version of the file, but you are not obligated to do so. - * If you do not wish to do so, delete this exception statement from your version. - */ -package mir.storage; - -import java.util.Properties; - -import mir.config.MirPropertiesConfiguration; -import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; - - -/** - * Diese Klasse implementiert die abstrakte Klasse DatabaseAdaptor - * - * @author - * @version 27.6.1999 - */ -public final class DatabaseAdaptorMySQL implements DatabaseAdaptor { - public String getDriver() throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.MySQL.Driver"); - } - - public String getURL(String user, String pass, String host) - throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.MySQL.URL"); - } - - public boolean hasLimit() { - return true; - } - - public boolean reverseLimit() { - return false; - } - - public Properties getProperties(String user, String password) { - return null; - } - - public String getLastInsertSQL(Database theDB) { - return "select last_insert_id()"; - } -} diff --git a/source/mir/storage/DatabaseAdaptorOracle.java b/source/mir/storage/DatabaseAdaptorOracle.java deleted file mode 100755 index f0366485..00000000 --- a/source/mir/storage/DatabaseAdaptorOracle.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2001, 2002 The Mir-coders group - * - * This file is part of Mir. - * - * Mir is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Mir is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Mir; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), - * and distribute linked combinations including the two. You must obey the - * GNU General Public License in all respects for all of the code used other than - * the above mentioned libraries. If you modify this file, you may extend this - * exception to your version of the file, but you are not obligated to do so. - * If you do not wish to do so, delete this exception statement from your version. - */ -package mir.storage; - -import java.util.Properties; - -import mir.config.MirPropertiesConfiguration; -import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; - - -/** - * Diese Klasse implementiert Interface DatabaseAdaptor fuer Oracle - * - * @author - * @version 15.05.2000 - */ -public final class DatabaseAdaptorOracle implements DatabaseAdaptor { - /** - * Liefert den Namen der Adaptorklasse Adaptor.Oracle.Driver - * f?r Oracle zur?ck. - * @return Adaptorklasse als String - */ - public String getDriver() throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.Oracle.Driver"); - } - - /** - * Liefert die URL f?r JDBC zur?ck, in den die Parameter user, pass und host - * eingef?gt werden. Die URL wird aus der Konfiguration geholt. - * - * @param user user als String - * @param pass passwort als String - * @param host host als String - * @return url als String - */ - public String getURL(String user, String pass, String host) - throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.Oracle.URL"); - - /** @todo hier muesste bessererweise $HOST durch HOST ersetzt, etc. werden */ - } - - /** - * Gibt zur?ck, ob das SQL der Datenbank den limit-Befehl beherrscht. - * @return false - */ - public boolean hasLimit() { - return false; - } - - /** - * Liefert zur?ck, ob der limit-Befehl erst start und dann offset - * hat (true), oder umgekehrt. Nur Relevant, wenn hasLimit true zur?ckliefert. - * - * @return false - */ - public boolean reverseLimit() { - return false; - } - - /** - * Liefert ein Properties-Objekt zurueck mit user und password. - * @param user - * @param password - * @return Properties - */ - public Properties getProperties(String user, String password) { - return null; - } - - public String getLastInsertSQL(Database theDB) { - return "select currval('" + theDB.getCoreTable() + "_id_seq')"; - } -} diff --git a/source/mir/storage/DatabaseAdaptorPostgresql.java b/source/mir/storage/DatabaseAdaptorPostgresql.java deleted file mode 100755 index 59ea2b55..00000000 --- a/source/mir/storage/DatabaseAdaptorPostgresql.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2001, 2002 The Mir-coders group - * - * This file is part of Mir. - * - * Mir is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Mir is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Mir; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), - * and distribute linked combinations including the two. You must obey the - * GNU General Public License in all respects for all of the code used other than - * the above mentioned libraries. If you modify this file, you may extend this - * exception to your version of the file, but you are not obligated to do so. - * If you do not wish to do so, delete this exception statement from your version. - */ -package mir.storage; - -import java.util.Properties; - -import mir.config.MirPropertiesConfiguration; -import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; - - -/** - * Diese Klasse implementiert die abstrakte Klasse DatabaseAdaptor f?r Postgresql-Datenbanken - * - * @author - * @version 30.12.2000 - */ -public final class DatabaseAdaptorPostgresql implements DatabaseAdaptor { - public String getDriver() throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.PostgreSQL.Driver"); - } - - public String getURL(String user, String pass, String host) - throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.PostgreSQL.URL"); - } - - public boolean hasLimit() { - return true; - } - - public boolean reverseLimit() { - return true; - } - - public Properties getProperties(String user, String password) { - return null; - } - - public String getLastInsertSQL(Database theDB) { - return "select currval('" + theDB.getCoreTable() + "_id_seq')"; - } -} diff --git a/source/mir/storage/DatabaseAdaptorSybase.java b/source/mir/storage/DatabaseAdaptorSybase.java deleted file mode 100755 index 3d9c8089..00000000 --- a/source/mir/storage/DatabaseAdaptorSybase.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2001, 2002 The Mir-coders group - * - * This file is part of Mir. - * - * Mir is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Mir is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Mir; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), - * and distribute linked combinations including the two. You must obey the - * GNU General Public License in all respects for all of the code used other than - * the above mentioned libraries. If you modify this file, you may extend this - * exception to your version of the file, but you are not obligated to do so. - * If you do not wish to do so, delete this exception statement from your version. - */ -package mir.storage; - -import java.util.Properties; - -import mir.config.MirPropertiesConfiguration; -import mir.config.MirPropertiesConfiguration.PropertiesConfigExc; - - -/** - * Diese Klasse implementiert Interface DatabaseAdaptor fuer Sybase - * - * @author - * @version 15.05.2000 - */ -public final class DatabaseAdaptorSybase implements DatabaseAdaptor { - /** - * Liefert den Namen der Adaptorklasse Adaptor.Sybase.Driver - * f?r Sybase zur?ck. - * @return Adaptorklasse als String - */ - public String getDriver() throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.Sybase.Driver"); - } - - /** - * Liefert die URL f?r JDBC zur?ck, in den die Parameter user, pass und host - * eingef?gt werden. Die URL wird aus der Konfiguration geholt. - * - * @param user user als String - * @param pass passwort als String - * @param host host als String - * @return url als String - */ - public String getURL(String user, String pass, String host) - throws PropertiesConfigExc { - return MirPropertiesConfiguration.instance().getString("Adaptor.Sybase.URL"); - - /** @todo hier muesste bessererweise $HOST durch HOST ersetzt, etc. werden */ - } - - /** - * Gibt zur?ck, ob das SQL der Datenbank den limit-Befehl beherrscht. - * @return false - */ - public boolean hasLimit() { - return false; - } - - /** - * Liefert zur?ck, ob der limit-Befehl erst start und dann offset - * hat (true), oder umgekehrt. Nur Relevant, wenn hasLimit true zur?ckliefert. - * - * @return false - */ - public boolean reverseLimit() { - return false; - } - - /** - * Liefert ein Properties-Objekt zurueck mit user und password. - * @param user - * @param password - * @return Properties - */ - public Properties getProperties(String user, String password) { - Properties props = new Properties(); - props.put("user", user); - props.put("password", password); - - return props; - } - - public String getLastInsertSQL(Database theDB) { - return "select currval('" + theDB.getCoreTable() + "_id_seq')"; - } -}