From 822e5678981d49ff25f1d9c12793562c84cd2b8d Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 23 Aug 2010 19:27:28 +0800 Subject: [PATCH] migrate oracle and postgresql provider to be equinox extension based. --- JasperReportsClient/build.xml | 2 +- .../src/org/compiere/report/JasperViewer.java | 12 +- base/plugin.xml | 1 + .../org.compiere.db.AdempiereDatabase.exsd | 109 ++++++++++++++ base/src/org/compiere/db/CConnection.java | 30 ++-- base/src/org/compiere/db/CreateAdempiere.java | 10 +- base/src/org/compiere/db/Database.java | 58 ++++---- base/src/org/compiere/db/TestConnection.java | 2 +- base/src/org/compiere/dbPort/Convert.java | 3 +- base/src/org/compiere/util/CCachedRowSet.java | 6 +- client/plugin.xml | 4 +- .../org/compiere/db/CConnectionDialog.java | 2 +- .../org/compiere/dbPort/ConvertDialog.java | 5 +- .../adempiere_equinox_swing.launch | 4 +- .../launchconfig/adempiere_equinox_web.launch | 4 +- .../org/compiere/install/ConfigOracle.java | 15 +- .../compiere/install/ConfigPostgreSQL.java | 9 +- oracleProvider/.classpath | 8 ++ oracleProvider/.project | 28 ++++ .../.settings/org.eclipse.jdt.core.prefs | 8 ++ .../.settings/org.eclipse.pde.core.prefs | 4 + oracleProvider/META-INF/MANIFEST.MF | 10 ++ oracleProvider/build.properties | 7 + oracleProvider/build.xml | 36 +++++ oracleProvider/plugin.xml | 12 ++ .../src/org/compiere/db/DB_Oracle.java | 0 .../org/compiere/dbPort/Convert_Oracle.java | 0 .../src/org/compiere/dbPort/JdbcTest.java | 0 pipoHandlers/build.xml | 2 +- postgresqlProvider/.classpath | 8 ++ postgresqlProvider/.project | 28 ++++ .../.settings/org.eclipse.jdt.core.prefs | 8 ++ .../.settings/org.eclipse.pde.core.prefs | 4 + postgresqlProvider/META-INF/MANIFEST.MF | 10 ++ postgresqlProvider/build.properties | 6 + postgresqlProvider/build.xml | 36 +++++ .../src/org/compiere/db/DB_PostgreSQL.java | 0 .../dbPort/ConvertMap_PostgreSQL.java | 0 .../compiere/dbPort/Convert_PostgreSQL.java | 0 .../dbPort/Convert_PostgreSQLTest.java | 0 .../src/org/compiere/dbPort/JdbcTestPG.java | 0 .../compiere/dbPort/PostgresConvertTest.java | 0 tools/.classpath | 2 - tools/META-INF/MANIFEST.MF | 136 ------------------ tools/build.properties | 2 - utils_dev/build.xml | 4 + 46 files changed, 398 insertions(+), 237 deletions(-) create mode 100644 base/schema/org.compiere.db.AdempiereDatabase.exsd create mode 100644 oracleProvider/.classpath create mode 100644 oracleProvider/.project create mode 100644 oracleProvider/.settings/org.eclipse.jdt.core.prefs create mode 100644 oracleProvider/.settings/org.eclipse.pde.core.prefs create mode 100644 oracleProvider/META-INF/MANIFEST.MF create mode 100644 oracleProvider/build.properties create mode 100644 oracleProvider/build.xml create mode 100644 oracleProvider/plugin.xml rename {base => oracleProvider}/src/org/compiere/db/DB_Oracle.java (100%) rename {base => oracleProvider}/src/org/compiere/dbPort/Convert_Oracle.java (100%) rename {base => oracleProvider}/src/org/compiere/dbPort/JdbcTest.java (100%) create mode 100644 postgresqlProvider/.classpath create mode 100644 postgresqlProvider/.project create mode 100644 postgresqlProvider/.settings/org.eclipse.jdt.core.prefs create mode 100644 postgresqlProvider/.settings/org.eclipse.pde.core.prefs create mode 100644 postgresqlProvider/META-INF/MANIFEST.MF create mode 100644 postgresqlProvider/build.properties create mode 100644 postgresqlProvider/build.xml rename {base => postgresqlProvider}/src/org/compiere/db/DB_PostgreSQL.java (100%) rename {base => postgresqlProvider}/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java (100%) rename {base => postgresqlProvider}/src/org/compiere/dbPort/Convert_PostgreSQL.java (100%) rename {base => postgresqlProvider}/src/org/compiere/dbPort/Convert_PostgreSQLTest.java (100%) rename {base => postgresqlProvider}/src/org/compiere/dbPort/JdbcTestPG.java (100%) rename {base => postgresqlProvider}/src/org/compiere/dbPort/PostgresConvertTest.java (100%) diff --git a/JasperReportsClient/build.xml b/JasperReportsClient/build.xml index cd52deab04..4c86c20c71 100644 --- a/JasperReportsClient/build.xml +++ b/JasperReportsClient/build.xml @@ -4,7 +4,7 @@ - + This buildfile is used to build the client subproject within diff --git a/JasperReportsClient/src/org/compiere/report/JasperViewer.java b/JasperReportsClient/src/org/compiere/report/JasperViewer.java index dbf02106e1..11ff3b8f60 100644 --- a/JasperReportsClient/src/org/compiere/report/JasperViewer.java +++ b/JasperReportsClient/src/org/compiere/report/JasperViewer.java @@ -117,13 +117,7 @@ public class JasperViewer extends javax.swing.JFrame { CConnection compiereConnection = CConnection.get(); try { - if (compiereConnection.isOracle()) - DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); - if (compiereConnection.isPostgreSQL()) - DriverManager.registerDriver(new org.postgresql.Driver()); -// if (compiereConnection.isSybase()) - //DriverManager.registerDriver(new com.sybase.jdbc3.jdbc.SybDriver()); -// DriverManager.registerDriver(new net.sourceforge.jtds.jdbc.Driver()); + DriverManager.registerDriver(compiereConnection.getDatabase().getDriver()); //this is for test only return DriverManager.getConnection(args[1], args[2], args[3]); @@ -132,9 +126,11 @@ public class JasperViewer extends javax.swing.JFrame { return null; } } + public static Connection getConnection() { + CConnection compiereConnection = CConnection.get(); try { - DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); + DriverManager.registerDriver(compiereConnection.getDatabase().getDriver()); //this is for test only prefer testingby calling org.compiere.report.JaserViewer JDBC_CONNECTION JDBC_USER JDBC_PASS return DriverManager.getConnection("jdbc:oracle:thin:@abalone.lesmuids.com:1521:abalone", "adempiere", "adempiere"); } catch (SQLException e) { diff --git a/base/plugin.xml b/base/plugin.xml index c3fd247a4e..f64414c49c 100644 --- a/base/plugin.xml +++ b/base/plugin.xml @@ -6,5 +6,6 @@ + diff --git a/base/schema/org.compiere.db.AdempiereDatabase.exsd b/base/schema/org.compiere.db.AdempiereDatabase.exsd new file mode 100644 index 0000000000..fdf4ae826b --- /dev/null +++ b/base/schema/org.compiere.db.AdempiereDatabase.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Oracle, PostgreSQL, etc + + + + + + + Implementation class name + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/base/src/org/compiere/db/CConnection.java b/base/src/org/compiere/db/CConnection.java index ab005af411..8657ebe06c 100644 --- a/base/src/org/compiere/db/CConnection.java +++ b/base/src/org/compiere/db/CConnection.java @@ -701,21 +701,17 @@ public class CConnection implements Serializable, Cloneable */ public void setType (String type) { - for (int i = 0; i < Database.DB_NAMES.length; i++) + if (Database.getDatabase(type) != null) { - if (Database.DB_NAMES[i].equals (type)) - { - m_type = type; - m_okDB = false; - break; - } + m_type = type; + m_okDB = false; } // Oracle if (isOracle ()) { - if (getDbPort () != DB_Oracle.DEFAULT_PORT) - setDbPort (DB_Oracle.DEFAULT_PORT); - setFwPort (DB_Oracle.DEFAULT_CM_PORT); + if (getDbPort () != Database.DB_ORACLE_DEFAULT_PORT) + setDbPort (Database.DB_ORACLE_DEFAULT_PORT); + setFwPort (Database.DB_ORACLE_DEFAULT_CM_PORT); } else { @@ -727,8 +723,8 @@ public class CConnection implements Serializable, Cloneable // PostgreSQL if (isPostgreSQL ()) { - if (getDbPort () != DB_PostgreSQL.DEFAULT_PORT) - setDbPort (DB_PostgreSQL.DEFAULT_PORT); + if (getDbPort () != Database.DB_POSTGRESQL_DEFAULT_PORT) + setDbPort (Database.DB_POSTGRESQL_DEFAULT_PORT); } //end vpj-cd e-evolution 09 ene 2006 } // setType @@ -1070,15 +1066,7 @@ public class CConnection implements Serializable, Cloneable { try { - for (int i = 0; i < Database.DB_NAMES.length; i++) - { - if (Database.DB_NAMES[i].equals (m_type)) - { - m_db = (AdempiereDatabase)Database.DB_CLASSES[i]. - newInstance (); - break; - } - } + m_db = Database.getDatabase(m_type); if (m_db != null) // test class loader ability m_db.getDataSource(this); } diff --git a/base/src/org/compiere/db/CreateAdempiere.java b/base/src/org/compiere/db/CreateAdempiere.java index aae07d3272..fa1b96dffe 100644 --- a/base/src/org/compiere/db/CreateAdempiere.java +++ b/base/src/org/compiere/db/CreateAdempiere.java @@ -102,15 +102,7 @@ public class CreateAdempiere { try { - for (int i = 0; i < Database.DB_NAMES.length; i++) - { - if (Database.DB_NAMES[i].equals (databaseType)) - { - m_dbTarget = (AdempiereDatabase)Database.DB_CLASSES[i]. - newInstance (); - break; - } - } + m_dbTarget = Database.getDatabase(databaseType); } catch (Exception e) { diff --git a/base/src/org/compiere/db/Database.java b/base/src/org/compiere/db/Database.java index d68e69157d..fea34d002d 100644 --- a/base/src/org/compiere/db/Database.java +++ b/base/src/org/compiere/db/Database.java @@ -16,7 +16,14 @@ *****************************************************************************/ package org.compiere.db; +import java.util.ArrayList; +import java.util.List; + +import org.adempiere.base.Service; +import org.adempiere.base.ServiceQuery; import org.compiere.util.CLogger; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; /** * General Database Constants and Utilities @@ -34,41 +41,42 @@ public class Database /** PostgreSQL ID */ public static String DB_POSTGRESQL = "PostgreSQL"; - /** Supported Databases */ - public static String[] DB_NAMES = new String[] { - DB_ORACLE - ,DB_POSTGRESQL - }; - - /** Database Classes */ - protected static Class[] DB_CLASSES = new Class[] { - DB_Oracle.class - ,DB_PostgreSQL.class - }; - /** Connection Timeout in seconds */ public static int CONNECTION_TIMEOUT = 10; + /** Default Port */ + public static final int DB_ORACLE_DEFAULT_PORT = 1521; + /** Default Connection Manager Port */ + public static final int DB_ORACLE_DEFAULT_CM_PORT = 1630; + + /** Default Port */ + public static final int DB_POSTGRESQL_DEFAULT_PORT = 5432; + /** * Get Database by database Id. * @return database */ public static AdempiereDatabase getDatabase (String type) - throws Exception { - AdempiereDatabase db = null; - for (int i = 0; i < Database.DB_NAMES.length; i++) - { - if (Database.DB_NAMES[i].equals (type)) - { - db = (AdempiereDatabase)Database.DB_CLASSES[i]. - newInstance (); - break; - } - } + ServiceQuery query = new ServiceQuery(); + query.put("id", type); + AdempiereDatabase db = Service.locate(AdempiereDatabase.class, query); return db; } + public static String[] getDatabaseNames() + { + List names = new ArrayList(); + IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(AdempiereDatabase.class.getName()); + for(IConfigurationElement element : elements) + { + String type = element.getAttribute("id"); + names.add(type); + } + String[] nameArray = names.toArray(new String[0]); + return nameArray; + } + /** * Get Database Driver by url string. * Access to database specific functionality. @@ -83,9 +91,9 @@ public class Database return null; } if (url.indexOf("oracle") != -1) - return new DB_Oracle(); + return getDatabase(DB_ORACLE); if (url.indexOf("postgresql") != -1) - return new DB_PostgreSQL(); + return getDatabase(DB_POSTGRESQL); log.severe("No Database for " + url); return null; diff --git a/base/src/org/compiere/db/TestConnection.java b/base/src/org/compiere/db/TestConnection.java index 38643e6fe0..30f6537d22 100644 --- a/base/src/org/compiere/db/TestConnection.java +++ b/base/src/org/compiere/db/TestConnection.java @@ -82,7 +82,7 @@ public class TestConnection { try { - DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); + DriverManager.registerDriver(Database.getDatabase(Database.DB_ORACLE).getDriver()); } catch (SQLException ex) { diff --git a/base/src/org/compiere/dbPort/Convert.java b/base/src/org/compiere/dbPort/Convert.java index 7a52d78601..c9350f8ecd 100644 --- a/base/src/org/compiere/dbPort/Convert.java +++ b/base/src/org/compiere/dbPort/Convert.java @@ -35,6 +35,7 @@ import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.compiere.db.Database; import org.compiere.model.MSysConfig; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; @@ -442,7 +443,7 @@ public abstract class Convert try { if (pgStatement == null) { // if oracle call convert for postgres before logging - Convert_PostgreSQL convert = new Convert_PostgreSQL(); + Convert convert = Database.getDatabase(Database.DB_POSTGRESQL).getConvert(); String[] r = convert.convert(oraStatement); pgStatement = r[0]; } diff --git a/base/src/org/compiere/util/CCachedRowSet.java b/base/src/org/compiere/util/CCachedRowSet.java index bcddbda823..13aa1a1168 100644 --- a/base/src/org/compiere/util/CCachedRowSet.java +++ b/base/src/org/compiere/util/CCachedRowSet.java @@ -26,8 +26,6 @@ import java.util.Locale; import javax.sql.RowSet; import javax.sql.rowset.CachedRowSet; -import oracle.jdbc.rowset.OracleCachedRowSet; - import org.compiere.db.AdempiereDatabase; import org.compiere.db.Database; @@ -106,7 +104,7 @@ public class CCachedRowSet extends CachedRowSetImpl implements CachedRowSet Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet rs = stmt.executeQuery(sql); - OracleCachedRowSet crs = new OracleCachedRowSet(); + CachedRowSetImpl crs = new CachedRowSetImpl(); crs.populate(rs); rs.close(); stmt.close(); @@ -133,7 +131,7 @@ public class CCachedRowSet extends CachedRowSetImpl implements CachedRowSet { if (db.getName().equals(Database.DB_ORACLE)) { - OracleCachedRowSet crs = new OracleCachedRowSet(); + CachedRowSetImpl crs = new CachedRowSetImpl(); crs.populate(rs); return crs; } diff --git a/client/plugin.xml b/client/plugin.xml index 7c99768293..77c0ea0b4b 100644 --- a/client/plugin.xml +++ b/client/plugin.xml @@ -7,9 +7,9 @@ id="RF" name="RF" point="org.adempiere.base.IResourceFinder"> - - + - + - + diff --git a/equinox-target/launchconfig/adempiere_equinox_web.launch b/equinox-target/launchconfig/adempiere_equinox_web.launch index 58e24ce0a8..d57466d86a 100644 --- a/equinox-target/launchconfig/adempiere_equinox_web.launch +++ b/equinox-target/launchconfig/adempiere_equinox_web.launch @@ -17,10 +17,10 @@ - + - + diff --git a/install/src/org/compiere/install/ConfigOracle.java b/install/src/org/compiere/install/ConfigOracle.java index d8ea91f294..7563f84dad 100644 --- a/install/src/org/compiere/install/ConfigOracle.java +++ b/install/src/org/compiere/install/ConfigOracle.java @@ -26,10 +26,7 @@ import java.sql.DriverManager; import java.util.ArrayList; import java.util.regex.Pattern; -import oracle.jdbc.OracleDriver; - -import org.compiere.db.DB_Oracle; - +import org.compiere.db.Database; /** * Oracle Configuration @@ -50,8 +47,6 @@ public class ConfigOracle extends Config m_XE = XE; } // ConfigOracle - /** Oracle Driver */ - private static OracleDriver s_oracleDriver = null; /** Discoverd TNS */ private String[] p_discovered = null; /** Discovered Database Name */ @@ -66,7 +61,7 @@ public class ConfigOracle extends Config */ public void init() { - p_data.setDatabasePort(String.valueOf(DB_Oracle.DEFAULT_PORT)); + p_data.setDatabasePort(String.valueOf(Database.DB_ORACLE_DEFAULT_PORT)); // p_data.setDatabaseSystemPassword(true); } // init @@ -428,11 +423,7 @@ public class ConfigOracle extends Config log.fine("Url=" + url + ", UID=" + uid); try { - if (s_oracleDriver == null) - { - s_oracleDriver = new OracleDriver(); - DriverManager.registerDriver(s_oracleDriver); - } + DriverManager.registerDriver(Database.getDatabase(Database.DB_ORACLE).getDriver()); m_con = DriverManager.getConnection(url, uid, pwd); } catch (UnsatisfiedLinkError ule) diff --git a/install/src/org/compiere/install/ConfigPostgreSQL.java b/install/src/org/compiere/install/ConfigPostgreSQL.java index a0f56907de..e6b58b7d79 100755 --- a/install/src/org/compiere/install/ConfigPostgreSQL.java +++ b/install/src/org/compiere/install/ConfigPostgreSQL.java @@ -17,7 +17,8 @@ package org.compiere.install; import java.net.InetAddress; import java.sql.Connection; -import org.compiere.db.DB_PostgreSQL; +import org.compiere.db.AdempiereDatabase; +import org.compiere.db.Database; /** * PostgreSQL Configuration @@ -39,15 +40,15 @@ public class ConfigPostgreSQL extends Config /** Discovered TNS */ private String[] p_discovered = null; - /** PostgreSQL DB Info */ - private DB_PostgreSQL p_db = new DB_PostgreSQL(); + + private AdempiereDatabase p_db = Database.getDatabase(Database.DB_POSTGRESQL); /** * Init */ public void init() { - p_data.setDatabasePort(String.valueOf(DB_PostgreSQL.DEFAULT_PORT)); + p_data.setDatabasePort(String.valueOf(Database.DB_POSTGRESQL_DEFAULT_PORT)); } // init /** diff --git a/oracleProvider/.classpath b/oracleProvider/.classpath new file mode 100644 index 0000000000..6c75e8d041 --- /dev/null +++ b/oracleProvider/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/oracleProvider/.project b/oracleProvider/.project new file mode 100644 index 0000000000..599b5c3239 --- /dev/null +++ b/oracleProvider/.project @@ -0,0 +1,28 @@ + + + oracleProvider + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/oracleProvider/.settings/org.eclipse.jdt.core.prefs b/oracleProvider/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..ef47a5f5a7 --- /dev/null +++ b/oracleProvider/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Mon Aug 23 18:48:06 MYT 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/oracleProvider/.settings/org.eclipse.pde.core.prefs b/oracleProvider/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 0000000000..d81e59360f --- /dev/null +++ b/oracleProvider/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,4 @@ +#Mon Aug 23 18:49:14 MYT 2010 +eclipse.preferences.version=1 +pluginProject.extensions=true +resolve.requirebundle=false diff --git a/oracleProvider/META-INF/MANIFEST.MF b/oracleProvider/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..12d80bb545 --- /dev/null +++ b/oracleProvider/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: OracleProvider +Bundle-SymbolicName: org.compiere.db.oracleProvider;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.adempiere.base;bundle-version="1.0.0", + org.adempiere.tools;bundle-version="1.0.0" +Bundle-ClassPath: ., + ojdbc6.jar diff --git a/oracleProvider/build.properties b/oracleProvider/build.properties new file mode 100644 index 0000000000..5f7921be44 --- /dev/null +++ b/oracleProvider/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + ojdbc6.jar +source.. = src/ diff --git a/oracleProvider/build.xml b/oracleProvider/build.xml new file mode 100644 index 0000000000..cd23e3dd96 --- /dev/null +++ b/oracleProvider/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + This buildfile is used to build the client subproject within + the Adempiere project. + + + + + + + + + + + + + + + + + + + + + diff --git a/oracleProvider/plugin.xml b/oracleProvider/plugin.xml new file mode 100644 index 0000000000..283468c75b --- /dev/null +++ b/oracleProvider/plugin.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/base/src/org/compiere/db/DB_Oracle.java b/oracleProvider/src/org/compiere/db/DB_Oracle.java similarity index 100% rename from base/src/org/compiere/db/DB_Oracle.java rename to oracleProvider/src/org/compiere/db/DB_Oracle.java diff --git a/base/src/org/compiere/dbPort/Convert_Oracle.java b/oracleProvider/src/org/compiere/dbPort/Convert_Oracle.java similarity index 100% rename from base/src/org/compiere/dbPort/Convert_Oracle.java rename to oracleProvider/src/org/compiere/dbPort/Convert_Oracle.java diff --git a/base/src/org/compiere/dbPort/JdbcTest.java b/oracleProvider/src/org/compiere/dbPort/JdbcTest.java similarity index 100% rename from base/src/org/compiere/dbPort/JdbcTest.java rename to oracleProvider/src/org/compiere/dbPort/JdbcTest.java diff --git a/pipoHandlers/build.xml b/pipoHandlers/build.xml index a2f3db9389..4031f5401d 100644 --- a/pipoHandlers/build.xml +++ b/pipoHandlers/build.xml @@ -4,7 +4,7 @@ - + This buildfile is used to build the client subproject within diff --git a/postgresqlProvider/.classpath b/postgresqlProvider/.classpath new file mode 100644 index 0000000000..1f7959b6b8 --- /dev/null +++ b/postgresqlProvider/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/postgresqlProvider/.project b/postgresqlProvider/.project new file mode 100644 index 0000000000..934d54ca4a --- /dev/null +++ b/postgresqlProvider/.project @@ -0,0 +1,28 @@ + + + postgresqlProvider + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/postgresqlProvider/.settings/org.eclipse.jdt.core.prefs b/postgresqlProvider/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..a7464d29fe --- /dev/null +++ b/postgresqlProvider/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Mon Aug 23 18:53:29 MYT 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/postgresqlProvider/.settings/org.eclipse.pde.core.prefs b/postgresqlProvider/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 0000000000..f67f2dcb5f --- /dev/null +++ b/postgresqlProvider/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,4 @@ +#Mon Aug 23 18:53:29 MYT 2010 +eclipse.preferences.version=1 +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/postgresqlProvider/META-INF/MANIFEST.MF b/postgresqlProvider/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..c9e6b46ec2 --- /dev/null +++ b/postgresqlProvider/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: PostgresqlProvider +Bundle-SymbolicName: org.compiere.db.postgreSQLProvider +Bundle-Version: 1.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ClassPath: ., + postgresql.jar +Require-Bundle: org.adempiere.base;bundle-version="1.0.0", + org.adempiere.tools;bundle-version="1.0.0" diff --git a/postgresqlProvider/build.properties b/postgresqlProvider/build.properties new file mode 100644 index 0000000000..4c37897a3d --- /dev/null +++ b/postgresqlProvider/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + postgresql.jar +source.. = src/ diff --git a/postgresqlProvider/build.xml b/postgresqlProvider/build.xml new file mode 100644 index 0000000000..88c33a2c81 --- /dev/null +++ b/postgresqlProvider/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + This buildfile is used to build the client subproject within + the Adempiere project. + + + + + + + + + + + + + + + + + + + + + diff --git a/base/src/org/compiere/db/DB_PostgreSQL.java b/postgresqlProvider/src/org/compiere/db/DB_PostgreSQL.java similarity index 100% rename from base/src/org/compiere/db/DB_PostgreSQL.java rename to postgresqlProvider/src/org/compiere/db/DB_PostgreSQL.java diff --git a/base/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java b/postgresqlProvider/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java similarity index 100% rename from base/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java rename to postgresqlProvider/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java diff --git a/base/src/org/compiere/dbPort/Convert_PostgreSQL.java b/postgresqlProvider/src/org/compiere/dbPort/Convert_PostgreSQL.java similarity index 100% rename from base/src/org/compiere/dbPort/Convert_PostgreSQL.java rename to postgresqlProvider/src/org/compiere/dbPort/Convert_PostgreSQL.java diff --git a/base/src/org/compiere/dbPort/Convert_PostgreSQLTest.java b/postgresqlProvider/src/org/compiere/dbPort/Convert_PostgreSQLTest.java similarity index 100% rename from base/src/org/compiere/dbPort/Convert_PostgreSQLTest.java rename to postgresqlProvider/src/org/compiere/dbPort/Convert_PostgreSQLTest.java diff --git a/base/src/org/compiere/dbPort/JdbcTestPG.java b/postgresqlProvider/src/org/compiere/dbPort/JdbcTestPG.java similarity index 100% rename from base/src/org/compiere/dbPort/JdbcTestPG.java rename to postgresqlProvider/src/org/compiere/dbPort/JdbcTestPG.java diff --git a/base/src/org/compiere/dbPort/PostgresConvertTest.java b/postgresqlProvider/src/org/compiere/dbPort/PostgresConvertTest.java similarity index 100% rename from base/src/org/compiere/dbPort/PostgresConvertTest.java rename to postgresqlProvider/src/org/compiere/dbPort/PostgresConvertTest.java diff --git a/tools/.classpath b/tools/.classpath index e827af5a84..22b833e5c3 100644 --- a/tools/.classpath +++ b/tools/.classpath @@ -116,8 +116,6 @@ - - diff --git a/tools/META-INF/MANIFEST.MF b/tools/META-INF/MANIFEST.MF index 1915ac7795..71790528f8 100644 --- a/tools/META-INF/MANIFEST.MF +++ b/tools/META-INF/MANIFEST.MF @@ -30,7 +30,6 @@ Bundle-ClassPath: tools.jar, lib/commons-logging.jar, lib/jgraph.jar, lib/logkit.jar, - lib/postgresql.jar, lib/wizard.jar, lib/xjavadoc-1.1.jar, lib/xml-apis.jar, @@ -43,7 +42,6 @@ Bundle-ClassPath: tools.jar, lib/commons-net-1.4.0.jar, lib/cron4j-2.2.1.jar, lib/payflow.jar, - lib/ojdbc6.jar, lib/c3p0-oracle-thin-extras-0.9.1.2.jar, lib/jcommon-1.0.16.jar, lib/jfreechart-1.0.13.jar, @@ -492,95 +490,6 @@ Export-Package: Lib, net.sourceforge.barbecue.linear.upc;uses:="net.sourceforge.barbecue,net.sourceforge.barbecue.output,net.sourceforge.barbecue.linear", net.sourceforge.barbecue.output;uses:="org.jdom", net.sourceforge.barbecue.twod.pdf417;uses:="net.sourceforge.barbecue,net.sourceforge.barbecue.output,net.sourceforge.barbecue.linear", - oracle.core.lmx, - oracle.core.lvf, - oracle.jdbc; - uses:="oracle.jdbc.internal, - oracle.jdbc.dcn, - oracle.jdbc.aq, - oracle.jdbc.driver, - oracle.sql, - oracle.jdbc.pool", - oracle.jdbc.aq;uses:="oracle.jdbc,oracle.sql", - oracle.jdbc.connector; - uses:="javax.resource.spi.endpoint, - javax.resource.spi, - javax.resource.spi.security, - javax.transaction.xa, - javax.security.auth, - javax.sql", - oracle.jdbc.dcn;uses:="oracle.jdbc,oracle.sql", - oracle.jdbc.diagnostics, - oracle.jdbc.driver; - uses:="oracle.jdbc.internal, - oracle.net.ns, - oracle.jdbc.dcn, - oracle.jdbc.xa, - oracle.jdbc.pool, - oracle.jdbc.oracore, - javax.management, - oracle.jdbc.aq, - javax.transaction.xa, - oracle.jdbc, - oracle.sql, - oracle.jdbc.xa.client", - oracle.jdbc.internal;x-internal:=true; - uses:="oracle.jdbc, - oracle.jdbc.oracore, - oracle.sql, - javax.transaction.xa, - oracle.jdbc.pool", - oracle.jdbc.oci;uses:="oracle.jdbc.driver", - oracle.jdbc.oracore;uses:="oracle.jdbc.internal,oracle.sql", - oracle.jdbc.pool; - uses:="oracle.jdbc.internal, - javax.transaction.xa, - oracle.jdbc.oci, - javax.naming.spi, - javax.sql, - oracle.jdbc, - javax.naming, - oracle.jdbc.driver, - oracle.ons", - oracle.jdbc.rowset; - uses:="javax.sql.rowset, - oracle.jdbc.internal, - org.xml.sax, - org.w3c.dom, - javax.sql, - oracle.jdbc, - oracle.jdbc.driver, - org.xml.sax.helpers, - javax.sql.rowset.spi", - oracle.jdbc.util, - oracle.jdbc.xa;uses:="javax.transaction.xa,oracle.jdbc.pool,javax.sql", - oracle.jdbc.xa.client; - uses:="oracle.jdbc.internal, - oracle.jdbc.driver, - javax.transaction.xa, - oracle.jdbc.xa, - javax.sql", - oracle.jpub.runtime;uses:="oracle.net.nl", - oracle.net.ano;uses:="oracle.net.ns,oracle.net.aso", - oracle.net.aso, - oracle.net.jdbc.TNSAddress, - oracle.net.jdbc.nl, - oracle.net.jdbc.nl.mesg, - oracle.net.jndi;uses:="javax.naming.directory,javax.net,javax.net.ssl", - oracle.net.mesg, - oracle.net.ns;uses:="oracle.net.ano,oracle.net.nt", - oracle.net.nt;uses:="javax.net.ssl", - oracle.net.resolver;uses:="oracle.net.TNSAddress,oracle.net.nt", - oracle.security.o3logon, - oracle.security.o5logon, - oracle.sql; - uses:="oracle.jdbc, - oracle.jdbc.internal, - oracle.jdbc.oracore, - oracle.jdbc.driver, - oracle.sql.converter", - oracle.sql.converter;uses:="oracle.jdbc.internal,oracle.i18n.text,oracle.i18n.text.converter", - oracle.sql.converter_xcharset, org.apache.activemq, org.apache.activemq.advisory, org.apache.activemq.blob, @@ -1382,51 +1291,6 @@ Export-Package: Lib, org.netbeans.api.wizard.displayer, org.netbeans.modules.wizard, org.netbeans.spi.wizard, - org.postgresql;uses:="org.postgresql.largeobject,org.postgresql.fastpath,org.postgresql.copy", - org.postgresql.copy;uses:="org.postgresql.core,org.postgresql", - org.postgresql.core;uses:="org.postgresql.jdbc2,org.postgresql.copy,org.postgresql", - org.postgresql.core.types, - org.postgresql.core.v2;uses:="org.postgresql.copy,org.postgresql.core,org.postgresql", - org.postgresql.core.v3;uses:="org.postgresql.copy,org.postgresql.core,org.postgresql", - org.postgresql.ds;uses:="org.postgresql.ds.jdbc4,org.postgresql.ds.common,javax.sql", - org.postgresql.ds.common;uses:="javax.naming,javax.naming.spi", - org.postgresql.ds.jdbc23; - uses:="javax.naming, - org.postgresql.ds.common, - org.postgresql.ds, - javax.sql", - org.postgresql.ds.jdbc4;uses:="org.postgresql.ds.jdbc23,javax.sql", - org.postgresql.fastpath;uses:="org.postgresql.core", - org.postgresql.geometric;uses:="org.postgresql.util", - org.postgresql.gss;uses:="org.postgresql.core,javax.security.auth.callback", - org.postgresql.jdbc2; - uses:="org.postgresql.fastpath, - org.postgresql.util, - org.postgresql.copy, - org.postgresql, - org.postgresql.largeobject, - org.postgresql.core", - org.postgresql.jdbc2.optional;uses:="org.postgresql.ds", - org.postgresql.jdbc3;uses:="org.postgresql.jdbc2,org.postgresql.core", - org.postgresql.jdbc3g;uses:="org.postgresql.jdbc3,org.postgresql.core", - org.postgresql.jdbc4; - uses:="org.postgresql.jdbc3, - org.xml.sax, - org.postgresql.jdbc3g, - org.postgresql.jdbc2, - org.postgresql.core, - javax.xml.transform", - org.postgresql.largeobject;uses:="org.postgresql.fastpath,org.postgresql.core", - org.postgresql.ssl;uses:="org.postgresql.core,javax.net.ssl", - org.postgresql.translation, - org.postgresql.util, - org.postgresql.xa; - uses:="javax.naming, - org.postgresql.ds.common, - org.postgresql.ds, - org.postgresql.core, - javax.transaction.xa, - javax.sql", org.python.compiler;uses:="org.python.parser,org.python.core,org.python.parser.ast", org.python.core; uses:="org.python.core.adapter, diff --git a/tools/build.properties b/tools/build.properties index 43593383c3..7250318c7f 100644 --- a/tools/build.properties +++ b/tools/build.properties @@ -28,7 +28,6 @@ bin.includes = META-INF/,\ lib/copyLibraries.bat,\ lib/jgraph.jar,\ lib/logkit.jar,\ - lib/postgresql.jar,\ lib/wizard.jar,\ lib/xjavadoc-1.1.jar,\ lib/xml-apis.jar,\ @@ -41,7 +40,6 @@ bin.includes = META-INF/,\ lib/commons-net-1.4.0.jar,\ lib/cron4j-2.2.1.jar,\ lib/payflow.jar,\ - lib/ojdbc6.jar,\ lib/c3p0-oracle-thin-extras-0.9.1.2.jar,\ lib/jcommon-1.0.16.jar,\ lib/jfreechart-1.0.13.jar,\ diff --git a/utils_dev/build.xml b/utils_dev/build.xml index 4e9e3cb14b..826bff6697 100644 --- a/utils_dev/build.xml +++ b/utils_dev/build.xml @@ -39,6 +39,8 @@ + + @@ -62,6 +64,8 @@ + +