从ORACLE 生成图片
public static void printPic()throws SQLException{ ResultSet rs=null; Connection conn=null; Statement stmt=null; try { //从ORACLE 生成图片 conn=getConn(); stmt=conn.createStatement(); rs=stmt.executeQuery("select zp from jczhxxgl.rk_zzrk where dbms_lob.getlength(zp)>0 and rownum<6"); int i=0; while(rs.next()){ InputStream fi=null; Blob blob = rs.getBlob("zp"); FileOutputS
access 取照片
public static void test_access_pic1(String table_id)throws SQLException{Connection conn=null;PreparedStatement stmt=null;ResultSet rs=null;int iiii=0;String[] sql_field_str=null;try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");String dburl ="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=两口一屋.mdb";//此为NO-DSN方式//String dburl ="jdbc:odbc:odbcName";//此为ODBC连接方式conn=DriverManager.getConnection(dburl);stmt=conn.prepareStatement("select pic fr
sql server and oracle stady
1,install the sql server gataway2,$oracle_home/tg4msql/admin/inittg4msql.ora# This is a sample agent init file that contains the HS parameters that are# needed for the Transparent Gateway for SQL Server## HS init parameters#HS_FDS_CONNECT_INFO="SERVER=192.168.0.47;DATABASE=pubs"HS_FDS_TRACE_LEVEL=ONHS_FDS_RECOVERY_ACCOUNT=RECOVERHS_FDS_RECOVERY_PWD=RECOVER3,update then file:$oracle_home/network/admin/listner.ora# LISTENER.ORA Network Configuration File: d:oracleora92NETWORKADMINlistene
check the sfzh
function f_chk_sfz_jym(as_sfzh varchar2) return number--校验身位最后一位是否合法isai_list number:=1;ai_i number:=17;ai_code number:=0;ai_mul number;as_idcode varchar2(18);as_18 char(1);beginas_idcode:=substrb(as_sfzh,1,17);while ai_i > 0 loopai_list := mod(ai_list * 2,11);ai_mul := to_number(substr(as_idcode,ai_i,1));ai_code := ai_code + ai_mul * ai_list;ai_i := ai_i - 1;end loop;ai_code := mod(ai_code,11);ai_code :=mod((12 - ai_code),11);if ai_code = 10 thenas_18 := 'X';elseas_18 :=to_char(a
the procedure:delete the data of one table
create or replace procedure truncatetable_test(tab_name varchar2) isThe_c1 Integer; The_result Integer;--dml_sql_result M_jls number; The_xh varchar2(2); beginThe_C1 :=Dbms_sql.open_cursor; Dbms_sql.parse(the_C1,'truncate table '||tab_name,dbms_sql.v7);The_result:=Dbms_sql.execute(The_c1); Dbms_sql.close_cursor(The_C1);dbms_output.put_line('d'||The_C1||'*');exceptionwhen others thendbms_output.put_line('d'||The_C1||'*');dbms_output.put_line(sqlerrm);dbms_output.put_line('d'||The_C1||'*');end tru
open the oracle 10g on linux
first: you must edit the file named /$oracle_home/bin/dbstart edit the $oracle_home_listenr=$oracle_homesecond: you must edit the file named /$orale_home/bin/dbshutwith the same third:edit the file called /etc/oratabold:new:four:create the file /etc/init.d/oracledb# !/bin/bash# whoami# root# chkconfig: 345 51 49# description: starts the oracle dabase deamons#ORACLE_HOME=/oracle/product/9idbORACLE_OWNER=oraclecase "$1" instart)echo -n "Starting oracle10g: "su - $ORACLE
ORA-29278: SMTP transient error: 421 Service not available
create or replace procedure souchang_Send_Email(p_txt varchar2, p_sub Varchar2, p_SendorAddress Varchar2, p_ReceiverAddress varchar2, p_EmailServer varchar2, p_Port Number Default 25,
write picture to oracle using java
import java.sql.*;import java.io.*;public class Blobtest {public Blobtest() {}public static void main (String args [])throws SQLException, IOException{ write(); //read();}static void read() throws SQLException, IOException { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@ebizser:1521:serverdb", "scott", "tiger"); conn.setAutoCommit (false); Statement