Can you put multiple statements in one query-string in Oracle jdbc?

I have a JDBC connection to an Oracle database. I create a Statement. The SQL query String contains multiple statements separated by a semicolon, and is provided by a different system.

Example:

connection.prepareStatement("SELECT * FROM A; SELECT * FROM B");

According to ddimitrov it isn't possible.

But all other databases I've tried support it. And JDBC even has support to retrieve multiple results.

Does anyone have either pointers to Oracle documentation explicitly stating that it is not supported or have a way to make it work (without using of stored procedures)?

Answers


For executing multiple statements:

JDBC 2.0 lets you submit multiple statements at one time with the addBatch method

See here.


Need Your Help

On embedded platforms, is it more efficient to use unsigned int instead of (implicity signed) int?

c architecture

I've got into this habit of always using unsigned integers where possible in my code, because the processor can do divides by powers of two on unsigned types, which it can't with signed types. Spee...

Don't make functions within loops javascript

javascript loops javascript-events event-listeners

I get that there are possibly three hundred of these questions, and I understand why not to. If we were looping saying a regular for loop, each iteration we are creating an anonymous function expre...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.