当前位置: 技术问答>java相关
我的问题在哪儿?请高手指教
来源: 互联网 发布时间:2015-07-18
本文导语: public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException { res.setContentType("Text/Html;charset=GB2312"); //ServletOutputStream out=res.getOutputStream(); PrintWriter out = res.getWriter(); ...
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
res.setContentType("Text/Html;charset=GB2312");
//ServletOutputStream out=res.getOutputStream();
PrintWriter out = res.getWriter();
boolean Judge = true;
//数据库的连接
Driver DateDriver;
Connection ComDate;
Statement StmtDate;
ResultSet ResultDate;
//测试
System.out.println("start try 26");
try{
System.out.println("start try 29");
DateDriver = (Driver)Class.forName("oracle.jdbc.driver.aaa").newInstance();
System.out.println("start try 31");
ComDate = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.39:1521:oracle","soft0701","abc");
StmtDate = ComDate.createStatement();
String SqlExe = "";
String s = "";
SqlExe = "select ID from users";
ResultDate = StmtDate.executeQuery(SqlExe);
s = ResultDate.getString("ID");
System.out.println(s);
} catch(Exception e){
//测试
System.out.println("start try catch 40");
}
为什么连不上服务器上的数据库
throws ServletException,IOException
{
res.setContentType("Text/Html;charset=GB2312");
//ServletOutputStream out=res.getOutputStream();
PrintWriter out = res.getWriter();
boolean Judge = true;
//数据库的连接
Driver DateDriver;
Connection ComDate;
Statement StmtDate;
ResultSet ResultDate;
//测试
System.out.println("start try 26");
try{
System.out.println("start try 29");
DateDriver = (Driver)Class.forName("oracle.jdbc.driver.aaa").newInstance();
System.out.println("start try 31");
ComDate = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.39:1521:oracle","soft0701","abc");
StmtDate = ComDate.createStatement();
String SqlExe = "";
String s = "";
SqlExe = "select ID from users";
ResultDate = StmtDate.executeQuery(SqlExe);
s = ResultDate.getString("ID");
System.out.println(s);
} catch(Exception e){
//测试
System.out.println("start try catch 40");
}
为什么连不上服务器上的数据库
|
哈哈
楼上很搞笑
楼上很搞笑
|
oracle.jdbc.driver.aaa
oracle几时有过这样的driver了??
你的出错提示是什么?
oracle几时有过这样的driver了??
你的出错提示是什么?