| Author |
JDBC Execute Method not working as expected
|
Mike London
Ranch Hand
Joined: Jul 12, 2002
Posts: 948
|
|
Using the (simple) JDBC code below, I can't seem to create temporary table... String tmpTableCreateSQL = "CREATE TEMPORARY TABLE IF NOT EXISTS tmpTable select * from customer"; boolean success = statement.execute(tmpTableCreateSQL); >>>> success always returns false. <<<<< I'd like to be able to get the temp table with something like: ResultSet temp = statement.getResultSet(); And then manipulate it with UPDATE statements and such. ===== Why isn't the initial statement returning true? I have lots of customer records and issuing this in an interactive tool works OK. Thanks in advance. - Mike
|
 |
Mike London
Ranch Hand
Joined: Jul 12, 2002
Posts: 948
|
|
I figured this out. Please disgregard this post. The reason I didn't get a ResultSet back because I had just done DDL statements. The ResultSet would happen if you then did a SELECT on the table temp table created using the DDL. Thanks anyway. - Mike
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
Mike, Thanks for posting the solution so that others who see this thread in the future can benefit.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Mike London
Ranch Hand
Joined: Jul 12, 2002
Posts: 948
|
|
No problem...glad to. The Ranch is the best!!! Mike
|
 |
 |
|
|
subject: JDBC Execute Method not working as expected
|
|
|