📄 connection1.java
字号:
/*
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -