Code example for Connection

Methods: isClosed

0
 
	public void delete(String uid) throws DataServiceException{
		try { 
			DeleteUserTokenCommand cmd = new DeleteUserTokenCommand();
 
			cmd.setConnection(getConnection());
			 
			cmd.setUid( uid);
			 
			cmd.execute();
 
		} catch (Exception e) {
 
			LOG.error("Failed to insert the uid,token", e);
			 
			throw new DataServiceException(e);
		} 
	} 
	 
	private Connection getConnection() throws  DataServiceException {
 
		// TODO talk about what is the connection strategy in georchestra  
		try { 
			if(this.connection == null || this.connection.isClosed() ){
				 
				try{ 
					Class.forName("org.postgresql.Driver");
					String url = this.jdbcURL;