PDA

View Full Version : Establishing Connection with MS-ACCESS Using GXT



durgesh2009.sahu
16 Jul 2012, 9:51 PM
Hi all,
I was trying to connect MS-Access database with GXT using following code....

private static Statement st=null;
private static ResultSet rs=null;
private static Connection con=null;
private static List<Stock> arr=new ArrayList<Stock>();


try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:dsn");
st=con.createStatement();
System.out.println("Connection: "+con);
rs=st.executeQuery("select * from Employee");
while(rs.next())
{
Stock s=new Stock();
s.setEmp_id(rs.getInt("emp_id"));
s.setEmp_name(rs.getString("emp_name"));
s.setSalary(rs.getDouble("salary"));
s.setEmp_address(rs.getString("emp_address"));
arr.add(s);
}
}
It gave me error at first line as " [ERROR] [binding] - Line 10: No source code is available for type java.sql.Statement; did you forget to inherit a required module?"

Does anybody have idea how should i connect GXT with MS-Access database..???

Thanks