← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 368: Removed unused jdbc related methods

 

------------------------------------------------------------
revno: 368
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-06-11 10:31:32 +0200
message:
  Removed unused jdbc related methods
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/BatchHandlerFactory.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/JDBCConfigurationProvider.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/StatementManager.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/configuration/DefaultJDBCConfigurationProvider.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/factory/DefaultBatchHandlerFactory.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/statement/JDBCStatementManager.java

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/BatchHandlerFactory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/BatchHandlerFactory.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/BatchHandlerFactory.java	2009-06-11 08:31:32 +0000
@@ -43,12 +43,4 @@
      * @return a BatchHandler instance.
      */
     BatchHandler createBatchHandler( Class<? extends BatchHandler> clazz );
-    
-    /**
-     * Creates a BatchHandler instance connected to the internal database.
-     * 
-     * @param clazz the BatchHandler class to create.
-     * @return a BatchHandler instance.
-     */
-    BatchHandler createInternalBatchHandler( Class<? extends BatchHandler> clazz );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/JDBCConfigurationProvider.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/JDBCConfigurationProvider.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/JDBCConfigurationProvider.java	2009-06-11 08:31:32 +0000
@@ -43,13 +43,4 @@
      * @return a JDBCConfiguration.
      */
     JDBCConfiguration getConfiguration();
-    
-    /**
-     * Creates a JDBCConfiguration, which holds properties for dialect, driverClass,
-     * connectionURL, username, and password for an internal, embedded, in-memory
-     * database.
-     * 
-     * @return a JDBCConfiguration.
-     */
-    JDBCConfiguration getInternalConfiguration();
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/StatementManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/StatementManager.java	2009-05-13 15:51:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/jdbc/StatementManager.java	2009-06-11 08:31:32 +0000
@@ -43,38 +43,18 @@
     void initialise();
     
     /**
-     * Initalizes a database connection and statement object for an internal, embedded,
-     * in-memory database which can be re-used
-     * for multiple operations.
-     */
-    void initialiseInternal();
-    
-    /**
      * Gets a pre-initialized statement object.
      * 
      * @return a pre-initialized statement object.
      */
     StatementHolder getHolder();
-        
-    /**
-     * Gets a pre-initialized statement object for an internal, embedded,
-     * in-memory database.
-     * 
-     * @return a pre-initialized statement object.
-     */
-    StatementHolder getInternalHolder();
-    
+       
     /**
      * Closes the statement object and the database connection.
      */
     void destroy();
     
     /**
-     * Closes the statement object and the internal database connection.
-     */
-    void destroyInternal();
-    
-    /**
      * Gets the current StatementBuilder.
      * 
      * @return the current StatementBuilder.

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/configuration/DefaultJDBCConfigurationProvider.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/configuration/DefaultJDBCConfigurationProvider.java	2009-04-22 15:28:47 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/configuration/DefaultJDBCConfigurationProvider.java	2009-06-11 08:31:32 +0000
@@ -104,17 +104,4 @@
         
         return config;
     }
-    
-    public JDBCConfiguration getInternalConfiguration()
-    {
-        JDBCConfiguration config = new JDBCConfiguration();
-        
-        config.setDialect( StatementDialect.H2 );
-        config.setDriverClass( "org.h2.Driver" );
-        config.setConnectionUrl( "jdbc:h2:mem:dhis2internal;DB_CLOSE_DELAY=-1" );
-        config.setUsername( "sa" );
-        config.setPassword( "" );
-        
-        return config;
-    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/factory/DefaultBatchHandlerFactory.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/factory/DefaultBatchHandlerFactory.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/factory/DefaultBatchHandlerFactory.java	2009-06-11 08:31:32 +0000
@@ -70,20 +70,6 @@
         }
     }
 
-    public BatchHandler createInternalBatchHandler( Class<? extends BatchHandler> clazz )
-    {
-        try
-        {
-            JDBCConfiguration configuration = configurationProvider.getInternalConfiguration();
-            
-            return createBatchHandler( clazz, configuration );
-        }
-        catch ( Exception ex )
-        {
-            throw new RuntimeException( "Failed to get BatchHandler", ex );
-        }
-    }
-
     // -------------------------------------------------------------------------
     // Supportive methods
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/statement/JDBCStatementManager.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/statement/JDBCStatementManager.java	2009-04-24 10:42:55 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/statement/JDBCStatementManager.java	2009-06-11 08:31:32 +0000
@@ -45,7 +45,6 @@
     implements StatementManager
 {
     private ThreadLocal<StatementHolder> holderTag = new ThreadLocal<StatementHolder>();
-    private ThreadLocal<StatementHolder> internalHolderTag = new ThreadLocal<StatementHolder>();
     
     // -------------------------------------------------------------------------
     // Dependencies
@@ -71,15 +70,6 @@
         holderTag.set( holder );
     }
     
-    public void initialiseInternal()
-    {
-        Connection connection = getInternalConnection();
-
-        StatementHolder holder = new DefaultStatementHolder( connection, true );
-        
-        internalHolderTag.set( holder );
-    }
-
     public StatementHolder getHolder()
     {
         StatementHolder holder = holderTag.get();
@@ -91,19 +81,7 @@
         
         return new DefaultStatementHolder( getConnection(), false );        
     }
-    
-    public StatementHolder getInternalHolder()
-    {
-        StatementHolder holder = internalHolderTag.get();
-        
-        if ( holder != null )
-        {
-            return holder;
-        }
-        
-        return new DefaultStatementHolder( getInternalConnection(), false );
-    }
-    
+        
     public void destroy()
     {
         StatementHolder holder = holderTag.get();
@@ -115,19 +93,7 @@
             holderTag.remove();
         }
     }
-    
-    public void destroyInternal()
-    {
-        StatementHolder holder = internalHolderTag.get();
-        
-        if ( holder != null )
-        {
-            holder.close();
-        
-            internalHolderTag.remove();
-        }
-    }
-    
+        
     public StatementBuilder getStatementBuilder()
     {
         return StatementBuilderFactory.createStatementBuilder( configurationProvider.getConfiguration().getDialect() );
@@ -157,25 +123,4 @@
             throw new RuntimeException( "Failed to create connection", ex );
         }
     }
-
-    private Connection getInternalConnection()
-    {
-        try
-        {
-            JDBCConfiguration configuration = configurationProvider.getInternalConfiguration();
-            
-            Class.forName( configuration.getDriverClass() );
-            
-            Connection connection = DriverManager.getConnection( 
-                configuration.getConnectionUrl(),
-                configuration.getUsername(),
-                configuration.getPassword() );
-            
-            return connection;
-        }
-        catch ( Exception ex )
-        {
-            throw new RuntimeException( "Failed to create internal connection", ex );
-        }
-    }
 }



--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.