开发者

accessing data from Database

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜