-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.4.1
-
x86
-
windows_2000
J2SE Version (please include all output from java -version flag):
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b06)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b06, mixed mode)
Bug Description:
The JDBC ODBC Bridge can't execute complex SELECT expressions.
Before it was execute it execute a
SELECT count(*) FROM ...
This is not working for complex SELECT expressions that work with other programs. The next problem occur
because this count can different with the count of the query. In the time between
the both query the count of rows can different in a multi thread and multi user enviroment.
*Connection.prepareStatement (SELECT tblBuchenNeu.*, tblArtikel.Warengruppe, tbl
Artikel.Untermen³s, tblArtikel.ARTIKEL, tblArtikel.Kategorie, tblWarengruppen.Be
zeichnung, tblWarengruppen.Talons, tblRechnungNeu.TNR, tblKellner.KName, tblWare
ngruppen.Sammelbon FROM (tblWarengruppen INNER JOIN tblArtikel ON tblWarengruppe
n.Warengruppe = tblArtikel.Warengruppe) INNER JOIN (tblRechnungNeu INNER JOIN (t
blBuchenNeu LEFT JOIN tblKellner ON tblBuchenNeu.KNR_Buchung = tblKellner.KNR) O
N tblRechnungNeu.RNR = tblBuchenNeu.RNR) ON tblArtikel.ANR = tblBuchenNeu.ANR WH
ERE ((tblBuchenNeu.BON=No) AND (tblBuchenNeu.Computer=? Or tblBuchenNeu.Computer
Is Null)) ORDER BY tblBuchenNeu.RNR, tblArtikel.Warengruppe, tblBuchenNeu.Gang,
IIf(DLookUp('IsZusatz','qryIsRechnungMitZusatz','RNR=' & [tblBuchenNeu].[RNR]),
[LFD_NR],1), tblBuchenNeu.ANR, tblBuchenNeu.ZNR)
Allocating Statement Handle (SQLAllocStmt), hDbc=182788016
hStmt=182794000
Setting statement option (SQLSetStmtOption), hStmt=182794000, fOption=6, vParam=
2
RETCODE = 1
WARNING - Generating SQLWarning...
SQLWarning: reason([Microsoft][ODBC Microsoft Access Driver]Der Optionswert wurd
e geõndert.) SQLstate(01S02) vendor code(10)
Setting statement option (SQLSetStmtOption), hStmt=182794000, fOption=7, vParam=
2
Preparing (SQLPrepare), hStmt=182794000, szSqlStr=SELECT tblBuchenNeu.*, tblArti
kel.Warengruppe, tblArtikel.Untermen³s, tblArtikel.ARTIKEL, tblArtikel.Kategorie
, tblWarengruppen.Bezeichnung, tblWarengruppen.Talons, tblRechnungNeu.TNR, tblKe
llner.KName, tblWarengruppen.Sammelbon FROM (tblWarengruppen INNER JOIN tblArtik
el ON tblWarengruppen.Warengruppe = tblArtikel.Warengruppe) INNER JOIN (tblRechn
ungNeu INNER JOIN (tblBuchenNeu LEFT JOIN tblKellner ON tblBuchenNeu.KNR_Buchung
= tblKellner.KNR) ON tblRechnungNeu.RNR = tblBuchenNeu.RNR) ON tblArtikel.ANR =
tblBuchenNeu.ANR WHERE ((tblBuchenNeu.BON=No) AND (tblBuchenNeu.Computer=? Or t
blBuchenNeu.Computer Is Null)) ORDER BY tblBuchenNeu.RNR, tblArtikel.Warengruppe
, tblBuchenNeu.Gang, IIf(DLookUp('IsZusatz','qryIsRechnungMitZusatz','RNR=' & [t
blBuchenNeu].[RNR]),[LFD_NR],1), tblBuchenNeu.ANR, tblBuchenNeu.ZNR
Number of parameter markers (SQLNumParams), hStmt=182794000
value=1
Registering Statement sun.jdbc.odbc.JdbcOdbcPreparedStatement@17f1ba3
Binding IN string parameter (SQLBindParameter), hStmt=182794000, ipar=1, SQLtype
=1, precision=255, scale=0, rgbValue=[B@1ef8cf3
*PreparedStatement.executeQuery
*PreparedStatement.execute
Free statement (SQLFreeStmt), hStmt=182794000, fOption=0
Executing (SQLExecute), hStmt=182794000
Number of result columns (SQLNumResultCols), hStmt=182794000
value=22
Get statement option (SQLGetStmtOption), hStmt=182794000, fOption=6
value=1
SQLWarning: reason(Result set type has been changed.)
Number of result columns (SQLNumResultCols), hStmt=182794000
value=22
Number of affected rows (SQLRowCount), hStmt=182794000
value=-1
Fetching (SQLFetchScroll), hStmt=182794000
End of result set (SQL_NO_DATA)
Get statement option (SQLGetStmtOption), hStmt=182794000, fOption=14
RETCODE = -1
ERROR - Generating SQLException...
SQLException: SQLState(24000) vendor code(0)
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Ung³ltiger Cursorstatus.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6877)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7034)
at sun.jdbc.odbc.JdbcOdbc.SQLGetStmtOption(JdbcOdbc.java:4369)
at sun.jdbc.odbc.JdbcOdbcResultSet.calculateRowCount(JdbcOdbcResultSet.java:6099)
at sun.jdbc.odbc.JdbcOdbcResultSet.initialize(JdbcOdbcResultSet.java:151)
at sun.jdbc.odbc.JdbcOdbcStatement.getResultSet(JdbcOdbcStatement.java:424)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:91)
at de.softsys.FunkServer.print.PrnBuchen.berichteBuchen(PrnBuchen.java:35)
at de.softsys.FunkServer.cmd.CmdRechnung.buchen(CmdRechnung.java:26)
at de.softsys.FunkServer.cmd.CmdRechnung.doExecute(CmdRechnung.java:16)
at de.softsys.FunkServer.cmd.BaseCmd.execute(BaseCmd.java:17)
at de.softsys.FunkServer.ClientSocket.run(ClientSocket.java:36)
at java.lang.Thread.run(Thread.java:536)
Fetching (SQLFetchScroll), hStmt=182794000
End of result set (SQL_NO_DATA)
*Connection.prepareStatement (SELECT COUNT(*) FROM (TBLWARENGRUPPEN INNER JOIN
TBLARTIKEL ON TBLWARENGRUPPEN.WARENGRUPPE = TBLARTIKEL.WARENGRUPPE) INNER JOIN (
TBLRECHNUNGNEU INNER JOIN (TBLBUCHENNEU LEFT JOIN TBLKELLNER ON TBLBUCHENNEU.KNR
_BUCHUNG = TBLKELLNER.KNR) ON TBLRECHNUNGNEU.RNR = TBLBUCHENNEU.RNR) ON TBLARTIK
EL.ANR = TBLBUCHENNEU.ANR WHERE ((TBLBUCHENNEU.BON=NO) AND (TBLBUCHENNEU.COMPUTE
R=? OR TBLBUCHENNEU.COMPUTER IS NULL)) ORDER BY TBLBUCHENNEU.RNR, TBLARTIKEL.WAR
ENGRUPPE, TBLBUCHENNEU.GANG, IIF(DLOOKUP('ISZUSATZ','QRYISRECHNUNGMITZUSATZ','RN
R=' & [TBLBUCHENNEU].[RNR]),[LFD_NR],1), TBLBUCHENNEU.ANR, TBLBUCHENNEU.ZNR)
Allocating Statement Handle (SQLAllocStmt), hDbc=182788016
hStmt=182788896
Setting statement option (SQLSetStmtOption), hStmt=182788896, fOption=6, vParam=
0
Setting statement option (SQLSetStmtOption), hStmt=182788896, fOption=7, vParam=
1
Preparing (SQLPrepare), hStmt=182788896, szSqlStr=SELECT COUNT(*) FROM (TBLWARE
NGRUPPEN INNER JOIN TBLARTIKEL ON TBLWARENGRUPPEN.WARENGRUPPE = TBLARTIKEL.WAREN
GRUPPE) INNER JOIN (TBLRECHNUNGNEU INNER JOIN (TBLBUCHENNEU LEFT JOIN TBLKELLNER
ON TBLBUCHENNEU.KNR_BUCHUNG = TBLKELLNER.KNR) ON TBLRECHNUNGNEU.RNR = TBLBUCHEN
NEU.RNR) ON TBLARTIKEL.ANR = TBLBUCHENNEU.ANR WHERE ((TBLBUCHENNEU.BON=NO) AND (
TBLBUCHENNEU.COMPUTER=? OR TBLBUCHENNEU.COMPUTER IS NULL)) ORDER BY TBLBUCHENNEU
.RNR, TBLARTIKEL.WARENGRUPPE, TBLBUCHENNEU.GANG, IIF(DLOOKUP('ISZUSATZ','QRYISRE
CHNUNGMITZUSATZ','RNR=' & [TBLBUCHENNEU].[RNR]),[LFD_NR],1), TBLBUCHENNEU.ANR, T
BLBUCHENNEU.ZNR
Number of parameter markers (SQLNumParams), hStmt=182788896
value=1
Registering Statement sun.jdbc.odbc.JdbcOdbcPreparedStatement@ecd7e
Binding IN string parameter (SQLBindParameter), hStmt=182788896, ipar=1, SQLtype
=1, precision=255, scale=0, rgbValue=[B@1d520c4
*PreparedStatement.executeQuery
*PreparedStatement.execute
Free statement (SQLFreeStmt), hStmt=182788896, fOption=0
Executing (SQLExecute), hStmt=182788896
RETCODE = -1
ERROR - Generating SQLException...
SQLException: SQLState(37000) vendor code(-3011)
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Sie wollten ein
e Abfrage ausf³hren, die den angegebenen Ausdruck 'TBLBUCHENNEU.RNR' nicht als T
eil der Aggregatfunktion einschlie¯t.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6877)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7034)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3102)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
at CUR_UPDATABLE );
pr.setString( 1, "Handy");
ResultSet rs = pr.executeQuery();
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b06)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b06, mixed mode)
Bug Description:
The JDBC ODBC Bridge can't execute complex SELECT expressions.
Before it was execute it execute a
SELECT count(*) FROM ...
This is not working for complex SELECT expressions that work with other programs. The next problem occur
because this count can different with the count of the query. In the time between
the both query the count of rows can different in a multi thread and multi user enviroment.
*Connection.prepareStatement (SELECT tblBuchenNeu.*, tblArtikel.Warengruppe, tbl
Artikel.Untermen³s, tblArtikel.ARTIKEL, tblArtikel.Kategorie, tblWarengruppen.Be
zeichnung, tblWarengruppen.Talons, tblRechnungNeu.TNR, tblKellner.KName, tblWare
ngruppen.Sammelbon FROM (tblWarengruppen INNER JOIN tblArtikel ON tblWarengruppe
n.Warengruppe = tblArtikel.Warengruppe) INNER JOIN (tblRechnungNeu INNER JOIN (t
blBuchenNeu LEFT JOIN tblKellner ON tblBuchenNeu.KNR_Buchung = tblKellner.KNR) O
N tblRechnungNeu.RNR = tblBuchenNeu.RNR) ON tblArtikel.ANR = tblBuchenNeu.ANR WH
ERE ((tblBuchenNeu.BON=No) AND (tblBuchenNeu.Computer=? Or tblBuchenNeu.Computer
Is Null)) ORDER BY tblBuchenNeu.RNR, tblArtikel.Warengruppe, tblBuchenNeu.Gang,
IIf(DLookUp('IsZusatz','qryIsRechnungMitZusatz','RNR=' & [tblBuchenNeu].[RNR]),
[LFD_NR],1), tblBuchenNeu.ANR, tblBuchenNeu.ZNR)
Allocating Statement Handle (SQLAllocStmt), hDbc=182788016
hStmt=182794000
Setting statement option (SQLSetStmtOption), hStmt=182794000, fOption=6, vParam=
2
RETCODE = 1
WARNING - Generating SQLWarning...
SQLWarning: reason([Microsoft][ODBC Microsoft Access Driver]Der Optionswert wurd
e geõndert.) SQLstate(01S02) vendor code(10)
Setting statement option (SQLSetStmtOption), hStmt=182794000, fOption=7, vParam=
2
Preparing (SQLPrepare), hStmt=182794000, szSqlStr=SELECT tblBuchenNeu.*, tblArti
kel.Warengruppe, tblArtikel.Untermen³s, tblArtikel.ARTIKEL, tblArtikel.Kategorie
, tblWarengruppen.Bezeichnung, tblWarengruppen.Talons, tblRechnungNeu.TNR, tblKe
llner.KName, tblWarengruppen.Sammelbon FROM (tblWarengruppen INNER JOIN tblArtik
el ON tblWarengruppen.Warengruppe = tblArtikel.Warengruppe) INNER JOIN (tblRechn
ungNeu INNER JOIN (tblBuchenNeu LEFT JOIN tblKellner ON tblBuchenNeu.KNR_Buchung
= tblKellner.KNR) ON tblRechnungNeu.RNR = tblBuchenNeu.RNR) ON tblArtikel.ANR =
tblBuchenNeu.ANR WHERE ((tblBuchenNeu.BON=No) AND (tblBuchenNeu.Computer=? Or t
blBuchenNeu.Computer Is Null)) ORDER BY tblBuchenNeu.RNR, tblArtikel.Warengruppe
, tblBuchenNeu.Gang, IIf(DLookUp('IsZusatz','qryIsRechnungMitZusatz','RNR=' & [t
blBuchenNeu].[RNR]),[LFD_NR],1), tblBuchenNeu.ANR, tblBuchenNeu.ZNR
Number of parameter markers (SQLNumParams), hStmt=182794000
value=1
Registering Statement sun.jdbc.odbc.JdbcOdbcPreparedStatement@17f1ba3
Binding IN string parameter (SQLBindParameter), hStmt=182794000, ipar=1, SQLtype
=1, precision=255, scale=0, rgbValue=[B@1ef8cf3
*PreparedStatement.executeQuery
*PreparedStatement.execute
Free statement (SQLFreeStmt), hStmt=182794000, fOption=0
Executing (SQLExecute), hStmt=182794000
Number of result columns (SQLNumResultCols), hStmt=182794000
value=22
Get statement option (SQLGetStmtOption), hStmt=182794000, fOption=6
value=1
SQLWarning: reason(Result set type has been changed.)
Number of result columns (SQLNumResultCols), hStmt=182794000
value=22
Number of affected rows (SQLRowCount), hStmt=182794000
value=-1
Fetching (SQLFetchScroll), hStmt=182794000
End of result set (SQL_NO_DATA)
Get statement option (SQLGetStmtOption), hStmt=182794000, fOption=14
RETCODE = -1
ERROR - Generating SQLException...
SQLException: SQLState(24000) vendor code(0)
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Ung³ltiger Cursorstatus.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6877)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7034)
at sun.jdbc.odbc.JdbcOdbc.SQLGetStmtOption(JdbcOdbc.java:4369)
at sun.jdbc.odbc.JdbcOdbcResultSet.calculateRowCount(JdbcOdbcResultSet.java:6099)
at sun.jdbc.odbc.JdbcOdbcResultSet.initialize(JdbcOdbcResultSet.java:151)
at sun.jdbc.odbc.JdbcOdbcStatement.getResultSet(JdbcOdbcStatement.java:424)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:91)
at de.softsys.FunkServer.print.PrnBuchen.berichteBuchen(PrnBuchen.java:35)
at de.softsys.FunkServer.cmd.CmdRechnung.buchen(CmdRechnung.java:26)
at de.softsys.FunkServer.cmd.CmdRechnung.doExecute(CmdRechnung.java:16)
at de.softsys.FunkServer.cmd.BaseCmd.execute(BaseCmd.java:17)
at de.softsys.FunkServer.ClientSocket.run(ClientSocket.java:36)
at java.lang.Thread.run(Thread.java:536)
Fetching (SQLFetchScroll), hStmt=182794000
End of result set (SQL_NO_DATA)
*Connection.prepareStatement (SELECT COUNT(*) FROM (TBLWARENGRUPPEN INNER JOIN
TBLARTIKEL ON TBLWARENGRUPPEN.WARENGRUPPE = TBLARTIKEL.WARENGRUPPE) INNER JOIN (
TBLRECHNUNGNEU INNER JOIN (TBLBUCHENNEU LEFT JOIN TBLKELLNER ON TBLBUCHENNEU.KNR
_BUCHUNG = TBLKELLNER.KNR) ON TBLRECHNUNGNEU.RNR = TBLBUCHENNEU.RNR) ON TBLARTIK
EL.ANR = TBLBUCHENNEU.ANR WHERE ((TBLBUCHENNEU.BON=NO) AND (TBLBUCHENNEU.COMPUTE
R=? OR TBLBUCHENNEU.COMPUTER IS NULL)) ORDER BY TBLBUCHENNEU.RNR, TBLARTIKEL.WAR
ENGRUPPE, TBLBUCHENNEU.GANG, IIF(DLOOKUP('ISZUSATZ','QRYISRECHNUNGMITZUSATZ','RN
R=' & [TBLBUCHENNEU].[RNR]),[LFD_NR],1), TBLBUCHENNEU.ANR, TBLBUCHENNEU.ZNR)
Allocating Statement Handle (SQLAllocStmt), hDbc=182788016
hStmt=182788896
Setting statement option (SQLSetStmtOption), hStmt=182788896, fOption=6, vParam=
0
Setting statement option (SQLSetStmtOption), hStmt=182788896, fOption=7, vParam=
1
Preparing (SQLPrepare), hStmt=182788896, szSqlStr=SELECT COUNT(*) FROM (TBLWARE
NGRUPPEN INNER JOIN TBLARTIKEL ON TBLWARENGRUPPEN.WARENGRUPPE = TBLARTIKEL.WAREN
GRUPPE) INNER JOIN (TBLRECHNUNGNEU INNER JOIN (TBLBUCHENNEU LEFT JOIN TBLKELLNER
ON TBLBUCHENNEU.KNR_BUCHUNG = TBLKELLNER.KNR) ON TBLRECHNUNGNEU.RNR = TBLBUCHEN
NEU.RNR) ON TBLARTIKEL.ANR = TBLBUCHENNEU.ANR WHERE ((TBLBUCHENNEU.BON=NO) AND (
TBLBUCHENNEU.COMPUTER=? OR TBLBUCHENNEU.COMPUTER IS NULL)) ORDER BY TBLBUCHENNEU
.RNR, TBLARTIKEL.WARENGRUPPE, TBLBUCHENNEU.GANG, IIF(DLOOKUP('ISZUSATZ','QRYISRE
CHNUNGMITZUSATZ','RNR=' & [TBLBUCHENNEU].[RNR]),[LFD_NR],1), TBLBUCHENNEU.ANR, T
BLBUCHENNEU.ZNR
Number of parameter markers (SQLNumParams), hStmt=182788896
value=1
Registering Statement sun.jdbc.odbc.JdbcOdbcPreparedStatement@ecd7e
Binding IN string parameter (SQLBindParameter), hStmt=182788896, ipar=1, SQLtype
=1, precision=255, scale=0, rgbValue=[B@1d520c4
*PreparedStatement.executeQuery
*PreparedStatement.execute
Free statement (SQLFreeStmt), hStmt=182788896, fOption=0
Executing (SQLExecute), hStmt=182788896
RETCODE = -1
ERROR - Generating SQLException...
SQLException: SQLState(37000) vendor code(-3011)
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Sie wollten ein
e Abfrage ausf³hren, die den angegebenen Ausdruck 'TBLBUCHENNEU.RNR' nicht als T
eil der Aggregatfunktion einschlie¯t.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6877)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7034)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3102)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
at CUR_UPDATABLE );
pr.setString( 1, "Handy");
ResultSet rs = pr.executeQuery();