jdk 的问题,请高手指教!
DBconn.java 如下:
package mysqltest;
import java.sql.*;
public class DBconn
{String DBDriver="org.gjt.mm.mysql.Driver";
String ConnStr="jdbc:mysql://localhost/my_test";
String MyUser="yzysy";
String MyPassword="yzysy";
Connection conn = null;
ResultSet rs = null;
public DBconn()
{try
{Class.forName(DBDriver);
}
catch(java.lang.ClassNotFoundException e)
{System.err.println("DBconn (): " + e.getMessage());
}
}
public ResultSet executeQuery(String sql)
{rs = null;
try
{conn = DriverManager.getConnection(ConnStr,MyUser,MyPassword);
Statement stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
}
catch(SQLException ex)
{System.err.println("aq.executeQuery:"+ex.getMessage());
}
return rs;
}
}
编译后,提示有100个错误,如下:
E:\JSP\jdk1.4\src.zip(java/net/URI.java):2662: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier
(source unavailable)
E:\JSP\jdk1.4\src.zip(java/net/InetAddress.java):695: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier
(source unavailable)
…………………………
E:\JSP\jdk1.4\src.zip(java/nio/DirectShortBufferS.java):332: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier
(source unavailable)
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.
100 errors
208 warnings
我用的是 j2sdk-1_4_2-windows-i586.exe
请高手指点一下,这是什么原因啊!急