what's wrong in the code.i'm not able to put the result in a
string object.
import java.sql.*;
class DataBaseConnect {
public static void main(String args[]) throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL=new String("jdbc

dbc:db1");
Connection con=DriverManager.getConnection(sourceURL);
Statement statement=con.createStatement();
ResultSet rs=statement.executeQuery("select productdescription from products where productid>1");
String str=rs.getString("productdescription");
while (rs.next())
{
System.out.println(str);
}
}
}