|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
QueryDataSet / bind variableLets take following code snippet: QueryDataSet q = new QueryDataSet(c); String query = "SELECT * FROM " + table + " WHERE NAME = ' " + name+ " ' ";
q.addTable(table, query); if (q.getTable(table).getRowCount() > 0) DatabaseOperation.DELETE.execute(c, q); In the above query I'm using a non-bind variable for 'name'.
Is there a way to use bind variables in this query? The query could look like this: String query = "SELECT * FROM " + table + " WHERE NAME = :? "; The result should be passed to QueryDataSet. Thanks ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
|
|
|
Re: QueryDataSet / bind variableHi
Thanks for the quick reply! The DELETE operation works if the query returns 1 record. If multiple records are found the DELETE operation throws For multiple records I get following exception:
java.lang.UnsupportedOperationException at org.dbunit.database.ForwardOnlyResultSetTable.getRowCount(ForwardOnlyResultSetTable.java:73)
at org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperation.java:148) I'm using dbunit 2.4.5
Any suggestions ? On Mon, Aug 3, 2009 at 10:31 PM, Matthias Gommeringer <Matthias.Gommeringer@...> wrote: Hi there, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
|
|
|
Re: QueryDataSet / bind variableThanks again for the quick reply!
And it works now. On Tue, Aug 4, 2009 at 11:20 PM, Matthias Gommeringer <Matthias.Gommeringer@...> wrote: Hi, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
| Free embeddable forum powered by Nabble | Forum Help |