开发者

accessing data from Database

开发者 https://www.devze.com 2023-02-10 19:11 出处:网络
I am connecting oracle database through OJDBC.RAR. when i try to list out all the data from the database it show only the data which contains in the first column. the remaining data are not visible.pl

I am connecting oracle database through OJDBC.RAR. when i try to list out all the data from the database it show only the data which contains in the first column. the remaining data are not visible. pls give me a solution

My Code:

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); 
Connection conn; 
ResultSet rs; 
Statement stm开发者_开发技巧t; 
conn = DriverManager.getConnection(jdbcURL, user, passwd); 
stmt = conn.createStatement(); //getting values from DBS 
rs = stmt.executeQuery("SELECT * FROM isroot"); 
rs.next(); 
id = rs.getString(1); 
name=rs.getString(2); 
genre=rs.getString(5);


 it show only the data which contains in the first column

You have to iterate your ResultSet Object to get all the values.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号