connection1.java
来自「个人办公平台,用JAVA开发的TOMCAT的服务器」· Java 代码 · 共 55 行
JAVA
55 行
/*
* Created on 2006-9-22
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.skyhawk.hydb;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class Connection1 {
public static Connection getConnection(HttpServletRequest request,HttpServletResponse response){
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("sjk");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Connection con = null;
try {
con =(Connection) java.sql.DriverManager.getConnection(
"jdbc:oracle:thin:@127.0.0.1:1521:oracle","system","dxjrplcmd");
System.out.println("===end====");
System.out.println("===ls====");
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return con;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?