¶ÔoracleÖеÄBLOBµÄ²Ù×÷(¶ÁÈ¡£¬Ð´Èë)
½«BLOB±£´æÎª±¾µØÎĵµ£º
/// <summary>
/// ¶Á³öBlob×Ö¶Î
/// </summary>
/// <param name="commandText">sqlÓï¾ä£¬Ö´Ðнá¹ûΪBLOBÊý¾Ý</param>
/// <param name="DocumentAddress">½«Òª°ÑBLOBÊý¾Ý±£´æÎªµÄÎĵµµÄ·¾¶</param>
public void ReadBlob(string commandText, string DocumentAddress)
{
try
{
Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = commandText;
// ÀûÓÃÊÂÎñ´¦Àí£¨±ØÐ룩
OracleTransaction transaction = cmd.Connection.BeginTransaction();
cmd.Transaction = transaction;
reader = cmd.ExecuteReader();
reader.Read();
OracleLob BLOB = reader.GetOracleLob(0);
reader.Close();
FileStream DataStream = new FileStream(DocumentAddress, FileMode.Create);
int length = 30485760;
byte[] Buffer = new byte[length];
int i;
while ((i = BLOB.Read(Buffer, 0, length)) > 0)
{
DataStream.Write(Buffer, 0, i);
}
DataStream.Close();
BLOB.Clone();
cmd.Transaction.Commit();
}
catch (OracleException e)
{
cmd.Transaction.Rollback();
throw e;
}
finally
{
Close();
}
}
½«±¾µØÎĵµ±£´æÎªBLOBÀàÐÍ£º
/// <summary>
/// дÈëBlob×Ö¶Î
/// </summary>
/// <param name="commandText">sqlÓï¾ä£¬Ö´Ðнá¹ûΪBLOBÊý¾Ý</param>
/// <param name="DocumentAddress">±¾µØÎĵµµÄ·¾¶</param>
public void WriteBlob(string commandText, string DocumentAddress
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬ÔÀ´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......
¸ù¾ÝǰЩÌìΪij´ó·É»ú¹«Ë¾µ¼Èëij´ó·É»úÉú²úÊý¾ÝµÄ¾Àú£¬×¼±¸Ð´Æª¹ØÓÚOracleµ¼³öÎļþDMP¸ñʽµÄ·ÖÎö£¬½á¹ûÔÚ±¾»úµ¼³öÒ»×éÑÝʾÊý¾Ýʱºò£¬³öÏÖÁË´íÎó£¬Ë³±ã½â¾öÏ¡£
±¾»ú×°µÄÊÇOracle 11g 32bit(11.0.6)µÄClient£¬Ö÷ÒªÊÇΪÁËʹÓÃODT.Net 11.0.6.21£¬Ö§³ÖVS2008¡£µ«ÊDzÉÓÃEXPÃüÁîµ¼³öÊý¾Ý¿âµÄʱºò£¬³öÏÖÁËЩ¹îÒìµÄ´íÎó¡£
Ö´Ð ......
¹ØÓÚoracleµÄÐм¶Ëø
¡¡¡¡ÔÚoracleÖÐ,Ðм¶ËøÖ»¶ÔÓû§ÕýÔÚ·ÃÎʵÄÐнøÐÐËø¶¨¡£
¡¡¡¡Èç¹û¸ÃÓû§ÕýÔÚÐÞ¸ÄijÐУ¬ÄÇôÆäËûÓû§¾Í¿ÉÒÔ¸üÐÂͬһ±íÖиÃÐÐÖ®ÍâµÄÊý¾Ý¡£
¡¡¡¡Ðм¶ËøÊÇÒ»ÖÖÅÅËûËø£¬·ÀÖ¹ÆäËûÊÂÎñÐ޸ĴËÐУ¬µ«ÊDz»»á×èÖ¹¶ÁÈ¡´ËÐеIJÙ×÷
¡£
¡¡¡¡ÔÚʹÓÃINSERT¡¢UPDATE¡¢DELETE ºÍSELECT…FOR UPDATE µÈÓï¾äʱ ......
ÔÎĵØÖ·£ºhttp://tech.it168.com/db/o/2006-08-09/200608091935599.shtml
& ......