java初级问题!!!+java能不能像.net一样调试?
import java.sql.*;
public class DBConnect
{
public static void main(String[] args) {
try //异常处理模块
{
System.out.println( "tt ");
String url= "jdbc:odbc:interweb ";
String ls_1= "select * from t_interdata ";
Class.forName( "com.ms.jdbc.odbc.JdbcOdbcDriver "); //加载驱动程序
// 建立连接
Connection con=DriverManager.getConnection(url, "sa ", " ");
// 执行SQL
Statement stmt=con.createStatement();
ResultSet result=stmt.executeQuery(ls_1); //返回结果
System.out.println( "编号 ");
int i=10;
while(result.next())
{
System.out.println(result.getString(1));
System.out.println(result.getString(2));
System.out.println(result.getString(3));
i+=20;
}
// 关闭连接
result.close();
stmt.close();
con.close();
}
// 捕获异常
catch(
SQLException ex){}
catch(
java.lang.Exception ex){}
}
}
------解决方案--------------------可以啊,加断点
------解决方案--------------------有工具 比如jb eclipse