日期:2014-05-16  浏览次数:20629 次

java程序查不出数据来

同样的错误,不可再犯第三次!!!

数据库中是char,里面带空格,但在pl/sql中这样写可以查出来。如下:

select ipostid from product t where ipostid= '212'
但在java中,如果是用jdbc的prepareStatement,这个执行sql就查不出数据来,需要:

select ipostid from pb_product where trim(ipostid)=?


查看oracle 用户执行的sql语句历史记录

下面的,没试过,也不知道好不好使

下面的内容转载自:http://cuichang.blog.hexun.com/31475039_d.html

select * from v$sqlarea t where t.PARSING_SCHEMA_NAME in ('用户名') order by t.LAST_ACTIVE_TIME desc
 

select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc

--注意 :执行此语句等等一些相关的语句 必须具有DBA 的权限 虽然这条语句很普通 但是需要的时候很管用 能够及时查出一个人执行sql语句情况

-------oracle 查看已经执行过的sql 这些是存在共享池中的 --------->
select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc

-----------查看oracle会话----------------------------》

select * from v$session   t order by t.LAST_ACTIVE_TIME desc

-------------查看oracle的权限角色------------------------------>
select   *   from   dba_role_privs;    授予用户和其他角色的角色   
select   *   from   dba_sys_privs;     授予用户和其他角色的系统权限   
select   *   from   dba_tab_privs;     数据库中对象的所有授权
select * from user_role_privs;         查看当前用户的角色