java.lang.Error: Unresolved compilation problems:
Unhandled exception type java.lang.IllegalAccessException
Unhandled exception type java.lang.InstantiationException
Unhandled exception type java.lang.ClassNotFoundException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at tst.tst.main(tst.java:23)
Exception in thread "main"
Unhandled exception type java.lang.IllegalAccessException
Unhandled exception type java.lang.InstantiationException
Unhandled exception type java.lang.ClassNotFoundException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException
Unhandled exception type java.sql.SQLException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at tst.tst.main(tst.java:23)
Exception in thread "main"
解决方案 »
- struts 使用 提交多条数据 结果显示不出来
- 微博中的粉丝或关注表怎么设计实体类 hibernate
- 用Hibernate出现了deleted object would be re-saved by cascade 异常
- 输入3位学生成绩 计算出其平均值 且排序的两种方法
- s2文件下载中文路径??
- java同步方法与同步块静态同步的区别
- <<<<你有这样的困扰吗?----软件学员找工作需要项目经验.
- 怎么实现动态参数提交?
- 为什么.jar文件不能执行
- 紧急求救!!!!!高手们救救我吧,在线等
- 100分求解 com.borland.primetime.util.AssertionException: gbk
- 高手帮忙看看这个问题,我是没辙了(关于在Struts中引用EJB)
{
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root&password=&useUnicode=true&characterEncoding=gb2312");
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("SELECT * from t1");
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));
rs.close();
stmt.close();
conn.close();
}
} public void use2()
{
try{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root&password=&useUnicode=true&characterEncoding=gb2312");//8859_1");
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("SELECT * from t1");
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));
rs.close();
stmt.close();
conn.close();
}
catch(Exception e)
{
System.out.println("error:"+e);
}
}
编译时的提示,
对不对?javac -nowarn不过,不能算是个好方法。