ここで、を介してデータベースに接続しようとしていJDBC
ます。
これが私のコードで、以下の例外が発生しました。
<%@ page import ="java.sql.*" %>
<%@ page import ="javax.sql.*" %>
<%
Connection con = null;
String url = "jdbc:jtds:sqlserver://192.168.0.123:4070/";
String db = "RUTHER_FORD";
String driver = "net.sourceforge.jtds.jdbc.Driver";
String userName ="RUTHER";
String password="SORRY_CONFIDENTIAL";
int sumcount=0;
Statement st;
try{
Class.forName(driver).newInstance();
con = DriverManager.getConnection(url+db,userName,password);
String query = "select * from user_master";
st = con.createStatement();
ResultSet rs = st.executeQuery(query);
%>
<%
while(rs.next()){
%>
<%System.out.println(rs.getString(1));%>
<%System.out.println(rs.getString(2));%>
<%
}
%>
<%
}
catch(Exception e){
e.printStackTrace();
}
%>
<html>
.
.
.
.
//以下は、ページをディスパッチするときに直面している例外です
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
以下に、もう1つの例外を見ました
java.security.AccessControlException: access denied (java.io.FilePermission C:\Windows\TEMP read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.File.isDirectory(File.java:752)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.unpackProperties(ConnectionJDBC2.java:1253)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:280)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.apache.jsp.mmrda_005fsupplierportal.index_002dleft_002dcontainer_jsp._jspService(index_002dleft_002dcontainer_jsp.java:71)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
P.S I added jtdc.1.2.5 jar to my `class path`.
何が欠けていますか??これに関する提案はありますか?
御時間ありがとうございます。