- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
- <%@ page import="java.sql.*"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <title>无标题文档</title>
- </head>
- <%
- String DBDRIVER="oracle.jdbc.driver.OracleDriver";
- String DBURL="jdbc:oracle:thin:@localhost:1521:orcl";
- String USER="system";
- String PWD="happytime";
- Connection conn=null;
- Statement stmt=null;
- try{
- Class.forName(DBDRIVER);
- conn=DriverManager.getConnection(DBURL,USER,PWD);
- stmt=conn.createStatement();
- String sql="create table cyhgoTable(name varchar(29))";
- stmt.executeUpdate(sql);
- stmt.close();
- conn.close();
- }catch(Exception ex)
- {
- out.println(ex);
- }
- %>
- <body>
- </body>
- </html>
JAVA连接oracle
最新推荐文章于 2023-04-20 10:14:06 发布