|
最初由 grimbomb 发布
[B]这个是引用创健数据库对像函数文件articleconn.jsp
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%Class.forName("oracle.jdbc.driver.OracleDriver" .newInstance();
//news为你的数据库的SID
String url="jdbc racle:thin:@localhost:1521:news";
String user="system";
String password="manager";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); %> [/B]
建议你先把业务逻辑包括建立数据库连接的代码封装到一个业务逻辑类中,在jsp中调用这些方法。 |
|