src/org/sonews/storage/impl/JDBCDatabaseProvider.java
changeset 37 74139325d305
parent 35 ed84c8bdd87b
child 42 7f84f4de2893
     1.1 --- a/src/org/sonews/storage/impl/JDBCDatabaseProvider.java	Sun Aug 29 17:28:58 2010 +0200
     1.2 +++ b/src/org/sonews/storage/impl/JDBCDatabaseProvider.java	Sun Aug 29 18:17:37 2010 +0200
     1.3 @@ -33,37 +33,29 @@
     1.4  public class JDBCDatabaseProvider implements StorageProvider
     1.5  {
     1.6  
     1.7 -  protected static final Map<Thread, JDBCDatabase> instances
     1.8 -    = new ConcurrentHashMap<Thread, JDBCDatabase>();
     1.9 +	protected static final Map<Thread, JDBCDatabase> instances = new ConcurrentHashMap<Thread, JDBCDatabase>();
    1.10  
    1.11 -  @Override
    1.12 -  public boolean isSupported(String uri)
    1.13 -  {
    1.14 -    throw new UnsupportedOperationException("Not supported yet.");
    1.15 -  }
    1.16 +	@Override
    1.17 +	public boolean isSupported(String uri)
    1.18 +	{
    1.19 +		throw new UnsupportedOperationException("Not supported yet.");
    1.20 +	}
    1.21  
    1.22 -  @Override
    1.23 -  public Storage storage(Thread thread)
    1.24 -    throws StorageBackendException
    1.25 -  {
    1.26 -    try
    1.27 -    {
    1.28 -    if(!instances.containsKey(Thread.currentThread()))
    1.29 -    {
    1.30 -      JDBCDatabase db = new JDBCDatabase();
    1.31 -      db.arise();
    1.32 -      instances.put(Thread.currentThread(), db);
    1.33 -      return db;
    1.34 -    }
    1.35 -    else
    1.36 -    {
    1.37 -      return instances.get(Thread.currentThread());
    1.38 -    }
    1.39 -    }
    1.40 -    catch(SQLException ex)
    1.41 -    {
    1.42 -      throw new StorageBackendException(ex);
    1.43 -    }
    1.44 -  }
    1.45 -
    1.46 +	@Override
    1.47 +	public Storage storage(Thread thread)
    1.48 +		throws StorageBackendException
    1.49 +	{
    1.50 +		try {
    1.51 +			if (!instances.containsKey(Thread.currentThread())) {
    1.52 +				JDBCDatabase db = new JDBCDatabase();
    1.53 +				db.arise();
    1.54 +				instances.put(Thread.currentThread(), db);
    1.55 +				return db;
    1.56 +			} else {
    1.57 +				return instances.get(Thread.currentThread());
    1.58 +			}
    1.59 +		} catch (SQLException ex) {
    1.60 +			throw new StorageBackendException(ex);
    1.61 +		}
    1.62 +	}
    1.63  }