Welcome to my blog, hope you enjoy reading
RSS

Friday, 18 January 2019

grant dbms_java.grant_permission

begin
  dbms_java.grant_permission
      ('SCOTT',
       'java.io.FilePermission',
       '<<ALL FILES>>',
       'execute');
  dbms_java.grant_permission
      ('SCOTT',
       'java.lang.RuntimePermission',
       '*',
       'writeFileDescriptor' );
end;
Share

Revoke DBMS_JAVA permissions


Revoke dbms_java permission

Query the dba_java_policy table

$sqlplus / as sysdba
SQL>select * from  dba_java_policy

KING      GRANTEE TYPE SCHEMA TYPE NAME                NAME ACTION ENABLED    SEQ

GRANT XXPMS    SYS                java.io.FilePermission   *   read ENABLED 178
GRANT XXPMS   SYS                java.io.FilePermission   /-   read,write  ENABLED 181
GRANT XXPMS   SYS                java.io.FilePermission       /bin/ls   execute ENABLED 180



Using the SEQ value, you can run the following statement to revoke the granted java permissions

eg: suppose you want to revoke SEQ 178

begin
  DBMS_JAVA.disable_permission(178);
  DBMS_JAVA.delete_permission(178);
end;
Share

Saturday, 28 April 2018

List ciphers used by JVM

List ciphers used by JVM 

import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import javax.net.ssl.SSLServerSocketFactory;

public class Ciphers
{
    public static void main(String[] args)
        throws Exception
    {
        SSLServerSocketFactory ssf = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();

        String[] defaultCiphers = ssf.getDefaultCipherSuites();
        String[] availableCiphers = ssf.getSupportedCipherSuites();

        TreeMap ciphers = new TreeMap();

        for(int i=0; i<availableCiphers.length; ++i )
            ciphers.put(availableCiphers[i], Boolean.FALSE);

        for(int i=0; i<defaultCiphers.length; ++i )
            ciphers.put(defaultCiphers[i], Boolean.TRUE);

        System.out.println("Default\tCipher");
        for(Iterator i = ciphers.entrySet().iterator(); i.hasNext(); ) {
            Map.Entry cipher=(Map.Entry)i.next();

            if(Boolean.TRUE.equals(cipher.getValue()))
                System.out.print('*');
            else
                System.out.print(' ');

            System.out.print('\t');
            System.out.println(cipher.getKey());
        }
    }
}


Source
Share

how to get the version of the Spring using Spring.jar

Using below two ways we can find the Spring version:
Process 1: using java program

import org.springframework.core.SpringVersion;

public class VersionChecker
{
    public static void main(String [] args)
    {
        System.out.println("version: " + SpringVersion.getVersion());
    }
}


Process 2: using md5

$ md5sum spring-2.5.5.jar
82a2134b227f717066da4f4b059925d3
http://www.google.com/search?q=82a2134b227f717066da4f4b059925d3
Share

Friday, 10 July 2015

Redo keyboard shortcut for eclipse

In Eclipse go to:

Window > Preferences > General > Editor > Keys


Type filter text to redo then select command.
copy command to give another shortcut to redo
-->Apply
-->OK.

source.
Share

A fatal error has been detected by the Java Runtime Environment: in ubuntu

$ sudo unlink /usr/lib/i386-linux-gnu/libsoup-2.4.so.1

souce.

Share

The system not connecting the internet and network symbol not showing in ubuntu


  • dhclient eth0
  • apt-get --reinstall install network-manager
Share

System Settings icons missing in 14.04


sudo apt-get install ubuntu-desktop

sudo apt-get install unity-control-center-signon gnome-control-center-unity

source
Share

Ubuntu software center keeps crashing

Ubuntu software center keeps crashing


  •     sudo apt-get install -f
  •      apt-get autoremove
  •      sudo apt-get purge software-center
  •      sudo apt-get update
  •      sudo apt-get dist-upgrade
  •      sudo apt-get install software-center
  •      sudo dpkg-reconfigure software-center --force
Share

Wednesday, 14 January 2015

How to include Java Source code within Eclipse?

How to include Java Source code within Eclipse?

In Netbeans, I can see the built-in sourse code of Java by clicking on LeftClick + Ctrl, and the .java file is shown:
Share