Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #394
| From | "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Client_Multi_Result F |
| Message-ID | <nospam-D8A904.08195007122008@nntp.motzarella.org> (permalink) |
| Newsgroups | comp.lang.java.databases |
| References | <96edcb85-5838-4564-a026-77c4aefd5873@t26g2000prh.googlegroup |
| Date | 2011-04-27 15:23 +0000 |
| Organization | TDS.net |
To: comp.lang.java.databases
In a recent series of articles, Zhane <zhane84@gmail.com> wrote:
Zhane:
> [...] it seem to be related to the client_multi_result
> flag. [I]'m using mysql-connector. [H]ow can I set this flag?
It may be possible to set CLIENT_MULTI_RESULT in the JDBC connect string:
<http://dev.mysql.com/doc/refman/6.0/en/connector-j-reference-configurati
on-properties.html>
Zhane:
> [I] cant find any property that is similar to that flag :(
Well, allowMultiQueries looks promising; you can use the indicated
syntax to try it: ... [?propertyName1][=propertyValue1]
Zhane:
> [T]his is the error [I] get when I try to execute the procedure.
What procedure? Should you be using prepareCall()?
Zhane:
>I changed it to prepareCall... but it doesnt make any difference
What code did you try? What result did you get? You have repeatedly
overlooked questions like these from me and others. I'm not sure how
anyone can help if you don't indicate precisely what you're doing and
how it went wrong:
<http://www.catb.org/~esr/faqs/smart-questions.html>
Elsewhere, you suggest that you intend to call a stored procedure:
> findFoodCode = connection.prepareStatement("CALL getFoodCode(?,?)");
You should use prepareCall(), set up the procedure's parameters, invoke
execute() on the CallableStatement, and get the return value:
<http://java.sun.com/javase/6/docs/api/java/sql/Connection.html>
<http://java.sun.com/javase/6/docs/api/java/sql/CallableStatement.html>
See also: Oracle Database JDBC Developer's Guide and Reference, Ch. 13.
Zhane:
> [W]hat sort of setup you mean? I did setString( ) for both my '?'s. I
> tried [th]e same code, but with the previously [P]repared[S]tatement
> type to now the [C]allable[S]tatement type.
What code did you try? What result did you get? I strongly urge you to
prepare an sscce <http://pscode.org/sscce.html> that invokes a simple
stored MySQL procedure via JDBC. This will help you understand what
unique issues arise in the process of porting your application to MySQL.
You have a bit of reading, studying and work to do:
<http://dev.mysql.com/doc/refman/6.0/en/stored-routines.html>
<http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html>
<http://www.onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html>
<http://www.java2s.com/Code/Java/Database-SQL-JDBC/CallStoredProcedureInM
ySql.htm>
[If you respond, after thorough study, please trim sigs.]
--
John B. Matthews
trashgod at gmail dot com
http://home.roadrunner.com/~jbmatthews/
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.databases | Previous | Next | Find similar
Re: Client_Multi_Result F "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
csiph-web