package dbbean;
import java.sql.*;
public class contactbean{
private connection con; //初始化连接。
public contactbean() {
try { class.forname("oracle.jdbc.driver.oracledriver").newinstance();
string url="jdbc:oracle:thin:@localhost:1521:hcm";
string user="jsp教程dev";
string password="19831007";
con= drivermanager.getconnection(url,user,password);
}
catch (instantiationexception e)
{ // todo auto-generated catch block
e.printstacktrace();
} catch (illegalaccessexception e)
{ // todo auto-generated catch block
e.printstacktrace();
}
catch(classnotfoundexception e)
{
system.out.println("driver not found!");
con=null;
}
catch(sqlexception e)
{ con=null; }
}
//代码二
class.forname("oracle.jdbc.driver.oracledriver").newinstance();?
string?url="jdbc:oracle:thin:@localhost:1521:orcl";?
//orcl为你的数据库教程的sid?
string?user="scott";?
string?password="tiger";?
connection?conn=?drivermanager.getconnection(url,user,password);?//
class.forname("oracle.jdbc.driver.oracledriver").newinstance();?
string?url="jdbc:oracle:thin:@localhost:1521:orcl";?
//orcl为你的数据库的sid?
string?user="scott";?
string?password="tiger";?
connection?conn=?drivermanager.getconnection(url,user,password);?
statement?stmt=conn.createstatement(resultset.type_scroll_sensitive,resultset.concur_updatable
%>
uc浏览器网页版入口官网-手机/电脑uc浏览器网页版入口地址
little fox官方网站入口地址-little fox网页版中国官网入口地址
樱花动漫网官网在线观看入口-樱花动漫网最新网页版入口地址2026
剑桥少儿英语官网入口网址-剑桥少儿英语网页版入口地址
手机百度网盘登录入口地址-百度网盘手机网页版登录入口地址
192.168.1.1无线路由怎么访问?192.168.1.1无线路由器设置登录入口地址