读取oracle blob字符串
OleDbConnectioncon=newOleDbConnection(cnnstr);
try
{
con.Open();
}
catch
{}
OleDbCommandcmd=newOleDbCommand(strSQL,con);
System.Data.OleDb.OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())
{
stringdd=dr["gggg"].ToString();
byte[]ooo=(byte[])dr["hhhh"];
stringstr;
str=System.Text.Encoding.Unicode.GetString(ooo);
this.textBox1.Text=str;
}
}
//向数据库中写入
private void button1_Click(object sender, EventArgs e)
{
oracleConnection1.Open();
OracleCommand cmd = new OracleCommand("UPDATE TEST SET F2 =:blob where F1=:sn ", oracleConnection1);
cmd.Parameters.Add(new OracleParameter("blob",OracleType.Blob));
cmd.Parameters.Add(new OracleParameter("sn",OracleType.Int32));
FileInfo fi = new FileInfo("c:\\dos.doc");
FileStream fs = fi.OpenRead();
byte[] MyData = new byte[fs.Length];
fs.Read(MyData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
cmd.Parameters["blob"].Value = MyData;
cmd.Parameters["sn"].Value = 1;
&nbs
相关文档:
Oracle JDeveloper 10g Release Download
Oracle JDeveloper 10g (version 9.0.5.1, build 1605) for Windows NT/2000/X, Linux, Solaris, and HP-UX.
http://download.oracle.com/otn/java/jdeveloper/905/jdev9051.zip
http://download-east.oracle.com/otn/java/jdeveloper/905/jdev9051.zip
http://download-west ......
Oracle
函
数之substr
关键字: substr
substr函数有三个参数,允许你将目标字符串的一部份输出,
第一个参数为目标字符串,
第二个字符串是将要输出的子串的起点,
第三个参数是将要输出的子串的长度。
例子1:
substr('ABCDEFG', 2, 3) ......
t表中将近有1100万数据,很多时候,我们要进行字符串匹配,在SQL语句中,我们通常使用like来达到我们搜索的目标。但经过实际测试发现,like的效率与instr函数差别相当大。下面是一些测试结果:
SQL> set timing on
SQL> select count(*) from t where instr(title,’手册’)>0;
COUNT(*)
—&md ......
Hey all,
Since there seems to be a fair bit of disinformation, and utter nonsense,
floating around since my talk at the Black Hat Federal security conference
the other day, I have decided to publish the following papers.
http://www.databasesecurity.com/HackingAurora.pdf
http://www.databasesec ......
导出和导入实用程序
q 导出和导入实用程序用于实施数据库的逻辑备份和恢复
q 导出实用程序将数据库中的对象定义和数据备份到一个操作系统二进制文件中
q 导入实用程序读取二进制导出文件并将对象和数据载入数据库中 ......