Manugal
05-01-2009, 19:23
Ciao a tutti!!
Sto usando questa libreria e vorrei interfacciarla con un DB. Ho provato ad eseguire la seguente query (attraverso il metodo executeQuery() di JDBCXYDataSet):
s.executeQuery("create view [V_NumLibriPU] as
select id, count(titolo) as NumLibri from libri,utenti
where id=idu and titolo not like \"%SCHEDA%\"
group by id");
s.executeQuery("select count(id) as NumUtenti, NumLibri
from V_NumLibriPU
group by id
order by NumLibri DESC");
Ma questo mi lancia la seguente eccezione: java.sql.SQLException: query does not return ResultSet
(Se provo a lanciarla una seconda volta mi dice che la tabella V_NumLibriPU già esiste, anche se chiudo il programma e lo riapro).
Dopodiché ho provato ad eseguire questa query al posto della precedente:
s.executeQuery("create view [V_NumLibriPU] as " +
"select id, count(titolo) as NumLibri " +
"from libri,utenti " +
"where id=idu and titolo not like \"%SCHEDA%\" " +
"group by id " +
"select count(id) as NumUtenti, NumLibri " +
"from V_NumLibriPU " +
"group by id " +
"order by NumLibri DESC");
Vorrei sapere se è possibile creare delle viste con tale metodo. Grazie.
Sto usando questa libreria e vorrei interfacciarla con un DB. Ho provato ad eseguire la seguente query (attraverso il metodo executeQuery() di JDBCXYDataSet):
s.executeQuery("create view [V_NumLibriPU] as
select id, count(titolo) as NumLibri from libri,utenti
where id=idu and titolo not like \"%SCHEDA%\"
group by id");
s.executeQuery("select count(id) as NumUtenti, NumLibri
from V_NumLibriPU
group by id
order by NumLibri DESC");
Ma questo mi lancia la seguente eccezione: java.sql.SQLException: query does not return ResultSet
(Se provo a lanciarla una seconda volta mi dice che la tabella V_NumLibriPU già esiste, anche se chiudo il programma e lo riapro).
Dopodiché ho provato ad eseguire questa query al posto della precedente:
s.executeQuery("create view [V_NumLibriPU] as " +
"select id, count(titolo) as NumLibri " +
"from libri,utenti " +
"where id=idu and titolo not like \"%SCHEDA%\" " +
"group by id " +
"select count(id) as NumUtenti, NumLibri " +
"from V_NumLibriPU " +
"group by id " +
"order by NumLibri DESC");
Vorrei sapere se è possibile creare delle viste con tale metodo. Grazie.