Atitti Dbutil Get multiple return result sets resolved

Source: Internet
Author: User

Atitti dbutil Get multiple return result sets resolved

1.1. multiple select defaults to return only the first resultset1

1.2. Calling a stored procedure, also returning 1 of the first select

1.3. if insert precedes,select , returns only one result set, in navicat inside Test 1

1.4. Solution splits multiple sql1 itself

parsing problems with 1.5. Int Update insert statement 2

System.setproperty ("Other_cfgfile", "cfg_game2.properties");

DBSERVICEV4QB9 DBC = Ioc4test.getbean (Dbservicev4qb9.class);

;

String sql = "Select ' OK ' as col";

Sql= "Insert Wxb_news (news_title,news_content) VALUES (' T2 ', ' C2 ');"

sql = "SELECT COUNT (*) as NUMX from Wxb_news;select * from Wxb_news;";

Object r = dbc.executequery (SQL);

System.out.println (Atijson.tojson (R));

System.out.println ("AA");

1.1. multiple select defaults to return only the first resultset

1.2. A stored procedure is called, and the first select is returned

SQL = "Call multi" ;

1.3. if insert precedes,select , returns only one result set, test in navicat

1.4. Solution splits multiple SQL itself

Public List executequery_multisql (String sql) {

List li = lists.newarraylist ();

string[] Sqls = Sql.split (";");

for (String Sql_tmp:sqls) {

List li_tmp = ExecuteQuery (sql_tmp);

Li.add (LI_TMP);

}

return Li;

}

[

[{

"Numx": 9

}],

[

{

"news_id": 1,

"News_title": " about the Spring Festival holiday period of the relevant instructions !",

"News_content": " about the Spring Festival holiday period to refund the relevant instructions ! " notes on returning money during the Spring festival holiday ! notes on returning money during the Spring festival holiday ! notes on returning money during the Spring festival holiday ! notes on returning money during the Spring festival holiday !",

"Click_num": 0,

"Show_top": "1",

"News_state": "0",

"Create_time": 1419160577000,

"Order_no": 4

},

1.5. parsing problem for Int Update insert statement

sql = "SELECT COUNT (*) as NUMX from Wxb_news;select * from wxb_news limit 2;";

Sql= "Insert Wxb_news (News_title,news_content,news_state,create_time) VALUES (' T2 ', ' C2 ', 0, ' 2017-1-1 ');" +sql;

Yes, I can. pass through the JSON JS validation.

var json=[

2,

[{

"Numx": 10

}],

[

{

"news_id": 1,

Console.log (Json[0]);

Console.log (json[1]);

Resources

Atitit JDBC Processing Returns multiple result sets

JDBC Update count line and call stored procedure return multiple result sets detailed -51cto.com.html

author :: nickname : old Wow's paw Claw of Eagle Idol wreck iconoclast Image-smasher

Bird King "Bird Catcher Kok devout pious religious defender Defender of The Faith. Caracalla Red cloak Caracalla red cloak king of Beasts

abbreviation:: Emir attilax Akbar Emile Atiraca

Full Name:: Emir Attilax Akbar bin Mahmud bin Attila bin Solomon bin Adam Al Rapanui Emile Atilax Akbaben Maham Solomon Ben Adam Arrapano Iraq

Common name: Etila (Ayron), Email:[email protected]

title:Head of Uke headquarters , founder of global Grid project,

president of Uke Friendship Association Uke Hunting Association President Emir chief chieftain of the Uke tribe,

Uke , Minister of Religious and Cultural Integration Affairs, Vice-Chairman of the Uke Reformation Commission

Uke System and chairman of the major conference committee,uke Security Department Chief Brigade , uke System Inspection Committee vice president,

Uke chief CTO Software Division Director of Technical department deputy Director of Research and Development department Director of Product department deputy Manager Project department deputy manager uke Science and Technology Research Institute Dean Uke Software Training Master

uke, head of regional chain of Polynesia District, Tonga Kingdom uke, head of chain, Line Is. Districtchain Head,uke Bouvet and South Georgia and South Sandwich Is. region chain Head

Uke, chairman of the Association of Software Standardization , Vice president of Uke Database and storage Standardization Association

Uke , founder of Uke Hospital and medical School, vice president of lifelong education school

UEC , President of Uecip , director of uke Document retrieval Department, head of Department of Image processing machine Vision

Uke, chief Dean of the School of image processing and machine vision

Uke Outdoor Sports Association chairman of the resort chief Mayor Uke Press editor

reprint Please indicate source:Attilax 's column ? http://www.cnblogs.com/attilax/

--atiend V8

Atitti Dbutil Get multiple return result sets resolved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.