/*
* demo.java
*
* Created on 2007年2月14日, 下午5:36
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
import java.sql.*;
/**
*
* @author Administrator
*/
public class demo {
/** Creates a new instance of demo */
public demo() {
}
public static void main(String[] args){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/hibernate","root","13570578");
Statement stat = conn.createStatement();
ResultSet rs = stat.executeQuery("select name from goods");
int i = 0;
while(rs.next()){
System.out.println(rs.getRowId(i).toString());
}
}catch(Exception e){
e.printStackTrace();
}
}
}