Hello, 
I’m update to netbeans 27 from netbeans12.2…. « Mind the gap! » 

I'm in trouble to access my sql JDBC.

Before, I did this :
ArrayList <String> render = new ArrayList <> ();
String requete="SELECT v.modplacesnom FROM modplaces v »;
render.addAll(this.listRequete(requete));
// With this : 
public List<String> listRequete( String requeteJQL) 
{    
    javax.persistence.criteria.CriteriaQuery cq = 
getEntityManager().getCriteriaBuilder().createQuery();
    cq.select(cq.from(entityClass));        
    return getEntityManager().createQuery(requeteJQL).getResultList();
}    

And it’s working fine.

Now, this is not working :
ArrayList <String> render = new ArrayList <> ();
String requete="SELECT v.modplacesnom FROM modplaces v »;
render.addAll(this.listRequete(requete));

// With this : 
public List<String> listRequete( String requeteJQL) 
{  
  jakarta.persistence.criteria.CriteriaQuery cq = 
getEntityManager().getCriteriaBuilder().createQuery();
  cq.select(cq.from(entityClass));        
  return getEntityManager().createQuery(requeteJQL).getResultList();
}  

All is good with jbdc driver, the access of the database is working fine when I 
tried other ways to access it, like 

public List<T> findAll() 
{
   jakarta.persistence.criteria.CriteriaQuery cq = 
getEntityManager().getCriteriaBuilder().createQuery();
   cq.select(cq.from(entityClass));
   return getEntityManager().createQuery(cq).getResultList();
}

just sql query is not working

The error page indicates : 
Exception [EclipseLink-0] (Eclipse Persistence Services - 
4.0.5.v202412231137-a96b873527f305f932543045c8679bb1de8d3a43): 
org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [SELECT v.modplacesnom FROM modplaces 
v]. 
[7, 21] The state field path 'v.modplacesnom' cannot be resolved to a valid 
type.
[27, 36] The abstract schema type 'modplaces' is unknown.

The only change is to put « jakarta » in place of « javax » … Is something 
wrong with this ?

Thanks for your help !

Jean-Michel




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to