¶ÔoracleÊý¾Ý¿âÖÐCLOB×ֶεÄÏà¹Ø²Ù×÷
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* ´Ë´¦²åÈëÀàÐÍ˵Ã÷¡£
* ´´½¨ÈÕÆÚ£º(2001/11/30 14:55:06)
* @author£ºzhubin
*/
public class BLOBUtil {
/**
* ¹¦ÄÜ˵Ã÷£º±àÂ뷽ʽ
* È¡Öµ·¶Î§£º
* ÒÀÀµÊôÐÔ£º
* ×îºóÐÞ¸Äʱ¼ä£º(2002-2-27 15:30:40)
*/
private static String codeSet;
/**
* ´Ë´¦²åÈë·½·¨ËµÃ÷¡£
* ´´½¨ÈÕÆÚ£º(2001/11/30 14:58:15)
* @return java.lang.String
* @param result java.sql.ResultSet
* @param index int
*/
public static String readBLOB(ResultSet result, int index) throws IOException,
SQLException
{
String strValue = null;
// ¶ÔÓÚSQL NULL£¬·½·¨getBinaryStream½«·µ»Ønull
InputStream in = result.getBinaryStream(index);
if (in == null) {
return "";
}
byte[] ba = new byte[8192];
ByteArrayOutputStream b = new ByteArrayOutputStream();
int i;
while((i = in.read(ba)) != -1){
b.write(ba, 0, i);
}
try{
strValue = b.toString(codeSet);
}catch(Exception e){
strValue = b.toString();
}
return strValue;
}
/**
* ´Ë´¦²åÈë·½·¨ËµÃ÷¡£
* ´´½¨ÈÕÆÚ£º(2001/11/30 14:59:52)
* @return java.lang.String
* @param result java.sql.ResultSet
* @param name java.lang.String
*/
public static String readBLOB(ResultSet result, String name) throws IOException,
SQLException
{
String strValue;
// ¶ÔÓÚSQL NULL£¬·½·¨getBinaryStream½«·µ»Ønull
InputStream in = result.getBinaryStream(name);
if (in == null) {
return "";
}
byte[] ba = new byte[8192];
ByteArrayOutputStream b = new ByteArrayOutputStream();
int i;
while((i = in.read(ba)) != -1){
b.write(ba, 0, i);
}
try{
strValue = b.toString(codeSet);
}catch(Exception e){
strValue = b.t
Ïà¹ØÎĵµ£º
Óαê
Ö¸ÏòÉÏÏÂÎÄÇøÓòµÄ¾ä±ú»òÖ¸Õë
ÓαêÔÚ·þÎñÆ÷¶Î´æ´¢
ÊôÐÔ
%NOTFOUND ûÓÐÕÒµ½½á¹û»òûÓвÙ×÷³É¹¦
%FOUND ÕÒµ½½á¹û»ò²Ù×÷³É¹¦
%ROWCOUNT ÓαêÓ°ÏìµÄÐÐÊý
%ISOPEN ÓαêÊÇ·ñ´ò¿ª Ò ......
OracleÁÙʱ±í¿ÉÒÔ˵ÊÇÌá¸ßÊý¾Ý¿â´¦ÀíÐÔÄܵĺ÷½·¨£¬ÔÚûÓбØÒª´æ´¢Ê±£¬Ö»´æ´¢ÔÚOracleÁÙʱ±í¿Õ¼äÖС£Ï£Íû±¾ÎÄÄܶԴó¼ÒÓÐËù°ïÖú¡£
1 ¡¢Ç°ÑÔ
Ä¿Ç°ËùÓÐʹÓà Oracle ×÷ΪÊý¾Ý¿âÖ§³Åƽ̨µÄÓ¦Ó㬴󲿷ÖÊý¾ÝÁ¿±È½ÏÅÓ´óµÄϵͳ£¬¼´±íµÄÊý¾ÝÁ¿Ò»°ãÇé¿ö϶¼ÊÇÔÚ°ÙÍò¼¶ÒÔÉϵÄÊý¾ÝÁ¿¡£
µ±È»ÔÚ Oracle Öд´½¨·ÖÇøÊÇÒ»ÖÖ²»´íµÄÑ¡Ôñ£¬µ« ......
Ê×ÏȲéÕÒÄ¿±êÓû§µÄµ±Ç°½ø³Ì£º
select sid,serial# from v$session where username='ERP';
²éѯ½á¹û£º
sid serial#
222 123
122 233
Ç¿ÐжϿªÓû§Á¬½Ó£º
alter system kill session 'sid,serial';
ÀýÈ磺
alter system kill session '222,123';
......
ÔÚOracleÊÇÌṩÁËnext_dayÇóÖ¸¶¨ÈÕÆÚµÄÏÂÒ»¸öÈÕÆÚ.
Óï·¨ : next_day( date, weekday )
date is used to find the next weekday.
weekday is a day of the week (ie: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY)
¿ÉÓÃÓÚ:
Oracle 9i, Oracle 10g, Oracle 11g
For example:
next_day('01- ......
Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü
ÉÏһƪ / ÏÂһƪ 2008-09-04 11:25:01
²é¿´( 1991 ) / ÆÀÂÛ( 0 ) / ÆÀ·Ö( 0 / 0 )
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_ ......