JDBC问题?
我用在Applet中用JDBC连接MS SQL Server7数据库,代码如下:
private void dbInit(){
/**使用JDBC-ODBC*/
// String dbDriver="sun.jdbc.odbc.JdbcOdbcDriver";
// String dbUrl="jdbc:odbc:leatherschool";
/**使用JDBC*/
String dbDriver="com.inet.tds.TdsDriver";
String dbUrl="jdbc:inetdae:localhost:1433?sql7=true";
String user="sa";
String pwd="";
try{
Class.forName(dbDriver);
Connection c=DriverManager.getConnection(dbUrl,user,pwd);
this.label1.setText("连接成功");
}catch(Exception e){
this.label1.setText(e.getMessage());
}
}
在appletViewer中可以“连接成功”但在IE5.0中却出现accessdenyied(java.net.SocketPermission 127.0.0.1:1433 connect,resolve)错误!