@Override
	public void create(DataObject obj) throws SQLException {
		if(!(obj instanceof ItemDO))
			throw new IllegalArgumentException("Tried to save a non StorageUnit in " +
					"DBStorageUnitDAO");
		PreparedStatement stmt = null;
		Statement keyStmt = null;
		ResultSet keyRS = null;
		SQLException exception = null;
		try{
			ItemDO item = (ItemDO)obj;
			ConnectionManager connectionManager = ConnectionManager.getConnectionManager();
			Connection connection = connectionManager.getConnection();
			
			stmt = connection.prepareStatement(CREATE);
		    stmt.setString(1, item.getBarCode());
		    stmt.setString(2, item.getEntryDate());
		    stmt.setString(3, item.getExitDate());
		    stmt.setString(4, item.getExpirationDate());
		    stmt.setLong(5, item.getProductId());
		    stmt.setLong(6, item.getContainerId());
		    
		    if (stmt.executeUpdate() == 1) {
		        keyStmt = connection.createStatement();
		        keyRS = keyStmt.executeQuery("select last_insert_rowid()");
		        keyRS.next();
		        int id = keyRS.getInt(1);   // ID of the new book
		        item.setId(id);
		    }else{
		    	throw new SQLException("Failed to insert StorageUnit");
		    }
		    
		    new DBppcDAO().create(item);
		}catch(SQLException e){
			exception = e;
		}finally {
		    if (stmt != null) stmt.close();
		    if (keyRS != null) keyRS.close();
		    if (keyStmt != null) keyStmt.close();
		    if (exception != null) throw exception;
		}
	}