public T findById(K id){	
		Connection con =null;
		PreparedStatement pst=null;
		ResultSet rs=null;
		T result=null;
		try{
			con= ds.getConnection();//Attempts to establish a connection with the data source that this DataSource object represents.
			QueryConditions[] conditions= getQueryConditionsFromKey(id);//Creamos condicion con id
			
			String whereConditions=generateWhereConditions(conditions);//String with 'where conditions'
			
			String sql="SELECT "+ " * "+" From "+getTableName() + whereConditions;//String with SQL statement, FALTABA EL "From table"
			
			pst = con.prepareStatement(sql);//An object that represents a pre-compiled SQL statement. 
			
			for (int i = 0; i < conditions.length; i++) {
				pst.setObject(i+1,conditions[i].getValor());
			}
			rs=pst.executeQuery();//Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query
			if(rs.next()){
				
				result = buildObject(rs);
			}
			
		}catch (SQLException e){
			e.printStackTrace();
		}finally{
			try{
				if(rs!=null) rs.close();
				if(pst!=null) pst.close();
				if(con!=null) con.close();
				
			}catch (Exception e){}
		}
		
		
		return result;
	}