public PreparedStatement getPreparedStatement(String name) {
		
		Connection conn = this.getConn();
		
		boolean exists = this.prepStat.containsKey(name);
		boolean isClosed = true;
		boolean isConn = false;
		
		PreparedStatement prest = null;

		// jeśli istnieje
		if(exists) {
			
			prest = this.prepStat.get(name);
			
			try {
                isClosed = prest.isClosed();
            }
            catch (SQLException e) {
                isClosed = true;
            }
			
			try {
				isConn = (prest.getConnection() == conn);
            }
            catch (SQLException e) {
            	isConn = false;
            }
		}
		
		
		if (!exists || !isConn || isClosed) {
			try {
				prest = conn.prepareStatement(this.prepSQL.get(name));
				this.prepStat.put(name, prest);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		
		try {
			prest.clearParameters();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return prest; 
	}