Category Archives: Database

Notes for Oracle SQL Usage

  General Functions Regardless of the logic purpose of the following codes, let go through each function that have been used within them   Round(Avg(To_Char(SysDate-7* RowNum,’ DD Month YYYY’)))   SYSDATE: Returns the current date-time from the server where the … Continue reading

Posted in Database | Leave a comment

Call SQL procedure and function with JDBC and Hibernate

  This article is to give some introductions of how to call the SQL procedure and function with JDBC and Hibernate feature.   Call SQL Procedure with JDBC   connection = openSessionInViewInterceptor .getSessionFactory().openStatelessSession().connection(); CallableStatement callableStatement = connection .prepareCall("call proc_my_procedure(?)"); callableStatement.setObject("in_user … Continue reading

Posted in Database | 10 Comments

Create new connection as SYSDBA with Oracle

Create new connection as SYSDBA   Create and delete user     Grant privileges You grant user privileges either by system or object GRANT system_privileges TO username GRANT system_privileges ON objectname TO username   Create database for user as SYSDBA … Continue reading

Posted in Database | Leave a comment