Posted: Sun May 14, 2006 6:27 pm Post subject: Connect to databse
Novice
Joined: 27 Apr 2006 Posts: 15
I create a jsp page. when I try to coonect to databse, i get an error :
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0204N "SYSTEM.MONHOC" is an undefined name. SQLSTATE=42704
and my code is fowlling :
Connection conn;
Statement sta;
ResultSet resultSet = null;
try {
Class.forName( "COM.ibm.db2.jdbc.app.DB2Driver" );
conn = DriverManager.getConnection( "jdbc:db2:BKDT" );
sta = conn.createStatement();
String str = "SELECT * FROM MONHOC";
resultSet = sta.executeQuery( str);
while ( resultSet.next())
{...}
}
catch (Exception e)
{...}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum