-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: <sql-query> error GenericJDBCException
PostPosted: Thu Jan 27, 2005 5:18 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
Using <sql-query> I get this error .Any idea?

net.sf.hibernate.exception.GenericJDBCException: error performing findBySQL
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4110)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3858)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at rt11000.printdocument.dao.PrintableDataDAO.findPrintableData(PrintableDataDAO.java:52)
at rt11000.printdocument.PrintManagerHibernateImpl.retrievePrintableData(PrintManagerHibernateImpl.java:38)
at rt11000.printdocument.Transformer.main(Transformer.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.sql.SQLException: Token SQL92 non supportato nella posizione: 43: dpd
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
at oracle.jdbc.driver.OracleSql.handleToken(OracleSql.java:202)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:122)
at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:70)
at oracle.jdbc.driver.OracleConnection.nativeSQL(OracleConnection.java:1249)
at oracle.jdbc.driver.OracleStatement.expandSqlEscapes(OracleStatement.java:6667)
at oracle.jdbc.driver.OracleStatement.parseSqlKind(OracleStatement.java:6656)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:152)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:92)
at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:1017)
at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:869)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:260)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:235)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:66)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:779)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3855)
... 9 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 27, 2005 6:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Syntax error in your SQL. Try executing it manually and fixing it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 27, 2005 6:50 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
Impossible.I try my select with SQL+ and it works.

I got problem with special hibernate mapping character as {,}

that my select
<sql-query name="printdocument.hibernate.decreto">
SELECT
tb.rit {dpd.rit} ,
tupf.cognome || ' ' || tupf.nome {dpd.procuratore},
tpp.nome {dpd.procedimentoPenale},
td.nome {dpd.decreto}, TO_CHAR(td.data_emissione, 'DD/MM/YYYY') {dpd.dataEmissione},
TO_CHAR(SYSDATE,'DD/MM/YYYY') {dpd.dataOggi}
FROM
T_BERSAGLI tb,
T_UTENTI tu,
T_DECRETI td,
T_PROCEDIMENTI_PENALI tpp,
T_UTENTI tupf
WHERE
tb.id_stato_bersaglio = 2
AND tu.login = 'administrator'
AND tb.id_decreto IN
(
SELECT DISTINCT id_decreto ID
FROM T_UTENTEGRUPPO_DECRETO
WHERE tipo_id_utentegruppo = 'U' AND id_utentegruppo = tu.ID
UNION
SELECT DISTINCT ud.id_decreto ID
FROM T_UTENTEGRUPPO_DECRETO ud, T_UTENTE_GRUPPO ug
WHERE ud.tipo_id_utentegruppo = 'G' AND ud.id_utentegruppo = ug.id_gruppo AND ug.id_utente = tu.ID
UNION
SELECT DISTINCT d.ID ID
FROM T_UTENTE_PROFILO up, T_UTENTE_GRUPPO ug, T_DECRETI d
WHERE up.id_profilo = 61 AND up.id_utente = tu.ID AND up.id_utente = ug.id_utente AND ug.id_gruppo = d.id_utente_pg_delegata
UNION
SELECT d.ID ID
FROM T_UTENTE_PROFILO up, T_DECRETI d
WHERE up.id_profilo = 4 AND up.id_utente = tu.ID
)
AND tb.id_decreto = td.ID
AND td.id_procedimento_penale = tpp.ID
AND tpp.id_utente_pm_firmatario = tupf.ID(+)
</sql-query>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 27, 2005 7:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
check the generated sql


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 27, 2005 7:47 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
Actually it gives me that:

Hibernate:

SELECT
tb.rit {dpd.rit} ,
tupf.cognome || ' ' || tupf.nome {dpd.procuratore},
tpp.nome {dpd.procedimentoPenale},
td.nome {dpd.decreto}, TO_CHAR(td.data_emissione, 'DD/MM/YYYY') {dpd.dataEmissione},
TO_CHAR(SYSDATE,'DD/MM/YYYY') {dpd.dataOggi}
FROM
T_BERSAGLI tb,
T_UTENTI tu,
T_DECRETI td,
T_PROCEDIMENTI_PENALI tpp,
T_UTENTI tupf
WHERE
tb.id_stato_bersaglio = 2
AND tu.login = 'administrator'
AND tb.id_decreto IN
(
SELECT DISTINCT id_decreto ID
FROM T_UTENTEGRUPPO_DECRETO
WHERE tipo_id_utentegruppo = 'U' AND id_utentegruppo = tu.ID
UNION
SELECT DISTINCT ud.id_decreto ID
FROM T_UTENTEGRUPPO_DECRETO ud, T_UTENTE_GRUPPO ug
WHERE ud.tipo_id_utentegruppo = 'G' AND ud.id_utentegruppo = ug.id_gruppo AND ug.id_utente = tu.ID
UNION
SELECT DISTINCT d.ID ID
FROM T_UTENTE_PROFILO up, T_UTENTE_GRUPPO ug, T_DECRETI d
WHERE up.id_profilo = 61 AND up.id_utente = tu.ID AND up.id_utente = ug.id_utente AND ug.id_gruppo = d.id_utente_pg_delegata
UNION
SELECT d.ID ID
FROM T_UTENTE_PROFILO up, T_DECRETI d
WHERE up.id_profilo = 4 AND up.id_utente = tu.ID
)
AND tb.id_decreto = td.ID
AND td.id_procedimento_penale = tpp.ID
AND tpp.id_utente_pm_firmatario = tupf.ID(+)

net.sf.hibernate.exception.GenericJDBCException: error performing findBySQL
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4110)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3858)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at rt11000.printdocument.dao.PrintableDataDAO.findPrintableData(PrintableDataDAO.java:52)
at rt11000.printdocument.PrintManagerHibernateImpl.retrievePrintableData(PrintManagerHibernateImpl.java:38)
at rt11000.printdocument.Transformer.main(Transformer.java:227)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.sql.SQLException: Token SQL92 non supportato nella posizione: 29: dpd
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
at oracle.jdbc.driver.OracleSql.handleToken(OracleSql.java:202)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:122)
at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:70)
at oracle.jdbc.driver.OracleConnection.nativeSQL(OracleConnection.java:1249)
at oracle.jdbc.driver.OracleStatement.expandSqlEscapes(OracleStatement.java:6667)
at oracle.jdbc.driver.OracleStatement.parseSqlKind(OracleStatement.java:6656)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:152)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:92)
at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:1017)
at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:869)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:260)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:235)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:66)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:779)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3855)
... 9 more


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.