?? _connectdb__jsp.java
字號(hào):
/*
* JSP generated by Resin-3.1.0 (built Fri, 22 Dec 2006 07:00:35 PST)
*/
package _jsp;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.sql.*;
public class _connectdb__jsp extends com.caucho.jsp.JavaPage
{
private final java.util.HashMap<String,java.lang.reflect.Method> _jsp_functionMap = new java.util.HashMap<String,java.lang.reflect.Method>();
private boolean _caucho_isDead;
Connection conn = null; //\u5b9a\u4e49Connection\u5bf9\u8c61
Statement stmt = null; //\u5b9a\u4e49Statement\u5bf9\u8c61
public void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
{
javax.servlet.http.HttpSession session = request.getSession(true);
com.caucho.server.webapp.WebApp _jsp_application = _caucho_getApplication();
javax.servlet.ServletContext application = _jsp_application;
com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false);
javax.servlet.jsp.JspWriter out = pageContext.getOut();
final javax.el.ELContext _jsp_env = pageContext.getELContext();
javax.servlet.ServletConfig config = getServletConfig();
javax.servlet.Servlet page = this;
response.setContentType("text/html;charset=gb2312");
request.setCharacterEncoding("GB2312");
try {
out.write(_jsp_string0, 0, _jsp_string0.length);
String hostName = "localhost"; // \u4e3b\u673a\u5730\u5740
String portNumber = "1521"; // \u7aef\u53e3\u53f7
String databaseSID = "orcl"; // \u670d\u52a1\u540d
String userName = "system"; // \u7528\u6237\u540d
String password = "PCSlee"; // \u5bc6\u7801
String url = "jdbc:oracle:thin:@"+hostName+":"+portNumber+":"+databaseSID; //\u8bbe\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32
try{
Class.forName("oracle.jdbc.driver.OracleDriver"); // \u52a0\u8f7d\u9a71\u52a8\u7a0b\u5e8f
conn = DriverManager.getConnection(url,userName,password); // \u8fde\u63a5\u6570\u636e\u5e93
conn.setAutoCommit(false); // \u5173\u95ed\u81ea\u52a8\u63d0\u4ea4\u529f\u80fd
stmt=conn.createStatement(); //\u521b\u5efaStatement\u5bf9\u8c61
String sql="select * from HR.Employees"; //\u8bbe\u7f6eSQL\u8bed\u53e5\uff0c\u8bbf\u95eeHR.Employee\u8868
ResultSet rs=stmt.executeQuery(sql); //\u6267\u884cSQL\u8bed\u53e5\uff0c\u8fd4\u56de\u7ed3\u679c\u96c6\u4e3ars
while(rs.next()){ //\u5faa\u73af\u663e\u793a\u7ed3\u679c\u96c6\u4e2d\u7684\u8bb0\u5f55\uff0crs.next()\u53ef\u4ee5\u79fb\u52a8\u6307\u9488\u5230\u4e0b\u4e00\u6761\u8bb0\u5f55
out.write(_jsp_string1, 0, _jsp_string1.length);
out.print((rs.getInt(1)));
out.write(_jsp_string2, 0, _jsp_string2.length);
out.print((rs.getString(2)));
out.write(_jsp_string3, 0, _jsp_string3.length);
}
out.print("<br>\u6570\u636e\u5e93\u64cd\u4f5c\u6210\u529f\uff0c\u606d\u559c\u4f60");
rs.close(); // \u5173\u95edrs
stmt.close(); // \u5173\u95edstmt
conn.close(); // \u5173\u95edconn
}
catch (Exception e){
System.out.println("=====Exception : DBOper connectDB() exception: " + e.getMessage());
}
out.write(_jsp_string4, 0, _jsp_string4.length);
} catch (java.lang.Throwable _jsp_e) {
pageContext.handlePageException(_jsp_e);
} finally {
com.caucho.jsp.QJspFactory.freePageContext(pageContext);
}
}
private java.util.ArrayList _caucho_depends = new java.util.ArrayList();
public java.util.ArrayList _caucho_getDependList()
{
return _caucho_depends;
}
public void _caucho_addDepend(com.caucho.vfs.PersistentDependency depend)
{
super._caucho_addDepend(depend);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
}
public boolean _caucho_isModified()
{
if (_caucho_isDead)
return true;
if (com.caucho.server.util.CauchoSystem.getVersionId() != 5022137076587403036L)
return true;
for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
com.caucho.vfs.Dependency depend;
depend = (com.caucho.vfs.Dependency) _caucho_depends.get(i);
if (depend.isModified())
return true;
}
return false;
}
public long _caucho_lastModified()
{
return 0;
}
public java.util.HashMap<String,java.lang.reflect.Method> _caucho_getFunctionMap()
{
return _jsp_functionMap;
}
public void init(ServletConfig config)
throws ServletException
{
super.init(config);
com.caucho.server.webapp.WebApp webApp
= (com.caucho.server.webapp.WebApp) config.getServletContext();
com.caucho.jsp.TaglibManager manager = webApp.getJspApplicationContext().getTaglibManager();
}
public void destroy()
{
_caucho_isDead = true;
super.destroy();
}
public void init(com.caucho.vfs.Path appDir)
throws javax.servlet.ServletException
{
com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
mergePath.addMergePath(appDir);
mergePath.addMergePath(resinHome);
com.caucho.loader.DynamicClassLoader loader;
loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
String resourcePath = loader.getResourcePathSpecificFirst();
mergePath.addClassPath(resourcePath);
com.caucho.vfs.Depend depend;
depend = new com.caucho.vfs.Depend(appDir.lookup("ConnectDB.jsp"), -3101524175829687234L, false);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
}
private final static char []_jsp_string1;
private final static char []_jsp_string3;
private final static char []_jsp_string0;
private final static char []_jsp_string4;
private final static char []_jsp_string2;
static {
_jsp_string1 = "\r\n \u7b2c\u4e00\u4e2a\u5b57\u6bb5\u5185\u5bb9\u4e3a\uff1a".toCharArray();
_jsp_string3 = "<br>\r\n ".toCharArray();
_jsp_string0 = "\r\n\r\n<html>\r\n<body>\r\n\r\n".toCharArray();
_jsp_string4 = "\r\n</body>\r\n</html>\r\n".toCharArray();
_jsp_string2 = "\r\n \u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5185\u5bb9\u4e3a\uff1a".toCharArray();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -