读取oracle中blog字段
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String URL=dbmes.url;
Connection con = DriverManager.getConnection(URL,dbmes.usrname,dbmes.pwd);
try{
// 准备语句执行对象
String bh=request.getParameter("dwmc");
Statement stmt = con.createStatement();
String sql = "select tp1 from HJ_ZDQY_TAB where dwmc='"+bh+"'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
Blob tp1 = rs.getBlob("tp1");
long size1 = tp1.length();
if(size1<=0){
rs.close();
response.sendRedirect("../images/error.jpg");
}else{
byte[] bs1 = tp1.getBytes(1, (int)size1);
response.setContentType("image/jpeg");
response.getOutputStream().write(bs1);
rs.close();
}
}else {
rs.close();
response.sendRedirect("../images/error.gif");
}
}
finally{
con.close();
}
out.clear();
out=pageContext.pushBody();
相关文档:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%--
使用JDBC连接Oracle数据库
--%>
<%!
String DBDRIVER="oracle.jdbc.driver.OracleDriver";
String URL="jdbc:oracle:thin:@localhost:1521:orcl";
String USER="scott ......
http://hi.baidu.com/fyears/blog/item/5ef68ac3feb9a45db219a836.html
select object_id,session_id,locked_mode from v$locked_object;
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid order by t2.logon_time;
alter system ki ......
package cn.edu.bit.test;
import java.sql.*;
public class Jdbc {
public static void main(String[] args)
{
try{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
System.out.p ......
使用的是ADODB库,需要有OCI8库.
<?php
//require("adodb5/adodb-exceptions.inc.php");
require("adodb5/adodb.inc.php");
$conn = NewADOConnection("oci8");
$conn->Connect($url, $user, $password, $service_name);
$rs;
try {
$rs = $conn->Execu ......