Java, returns multiple types of Arrays

Source: Internet
Author: User

 

XMLRPC returns an object multi-type array.

Public object database (int id) <br/>{< br/> object [] [] rowdata = new object [5] []; <br/> string html = new string (); <br/> try {<br/> // The newinstance () call is a work around for some <br/> // broken Java implementations <br/> class. forname ("org. postgreSQL. driver "). newinstance (); <br/>}< br/> catch (exception e) {<br/> // out. println ("unable to load driver. "); <br/> E. printstacktrace (); <br/>}< br /> Try {<br/> connection conn = <br/> drivermanager. getconnection ("JDBC: PostgreSQL: // localhost: 5432/tE <br/> st? User = iuser & Password = IABC "); <br/> statement stmt = Conn. createstatement (); <br/> int sum = (ID-1) * 2; <br/> resultset rs = stmt.exe cutequery ("select * from users" + <br/> "order by ID offset" + ID + "limit 5 "); <br/> int I =-1; <br/> while (RS. next () {<br/> I ++; <br/> rowdata [I] = new object [3]; <br/> rowdata [I] [0] = Rs. getint (1); <br/> rowdata [I] [1] = Rs. getstring (2); <br/> rowdata [I] [2] = Rs. getstring (3); <br/>}< br/> Rs. close (); <br/> stmt. close (); <br/> Conn. close (); <br/>}catch (sqlexception e) {<br/> E. getmessage (); E. getsqlstate (); E. geterrorcode (); </P> <p >}< br/> return rowdata; <br/>}< br/>

 

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.