begin
dbms_java.grant_permission
('SCOTT',
'java.io.FilePermission',
'<<ALL FILES>>',
'execute');
dbms_java.grant_permission
('SCOTT',
'java.lang.RuntimePermission',
'*',
'writeFileDescriptor' );
end;
Friday, 18 January 2019
grant dbms_java.grant_permission
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
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;
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
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
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
Friday, 10 July 2015
Redo keyboard shortcut for eclipse
In Eclipse go to:
Window > Preferences > General > Editor > Keys
source.
Window > Preferences > General > Editor > Keys
Type filter text to redo then select command.
copy command to give another shortcut to redo
-->Apply
-->OK.source.
Labels:
eclipse
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
Labels:
ubuntu
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
Labels:
ubuntu
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:
In Netbeans, I can see the built-in sourse code of Java by clicking on LeftClick + Ctrl, and the .java file is shown:
Labels:
eclipse
Tuesday, 13 January 2015
android Error in http connectionjavajava.lang.SecurityException: Permission denied (missing INTERNET permission?)
android Error in http connectionjavajava.lang.SecurityException: Permission denied (missing INTERNET permission?)
solution:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
solution:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
Labels:
android
“appcompat_v7” project is created automaticaly after creating a new project in Eclipse
“appcompat_v7” project is created automaticaly after creating a new project in Eclipse
Do as follows to overcome this issue, this works for me. Create project as usual than follow below steps
Do as follows to overcome this issue, this works for me. Create project as usual than follow below steps
Labels:
android
Count number of Delimited value in Column in mysql
Now i want count no of items in one particular row in one particular cell.
i.e If i have 25,45,26,45,46 in a cell in table.
I want the output like 5
Solution:
If data is end with delimiter then
Query: SELECT LENGTH(yourColumn) - LENGTH(REPLACE(yourColumn, ',', '')) AS numberOfItemsInRow FROM yourTable;
example:
SELECT LENGTH('123,123,') - LENGTH(REPLACE('123,123,', ',', '')) AS numberOfItemsInRow;
o/p: 2
If data is not end with delimiter
Query: SELECT LENGTH(yourColumn) - LENGTH(REPLACE(yourColumn, ',', '')) + 1 AS numberOfItemsInRow FROM yourTable;
example:
SELECT LENGTH('123,123') - LENGTH(REPLACE('123,123', ',', ''))+1 AS numberOfItemsInRow;
o/p: 2
Labels:
database
Saturday, 8 November 2014
APACHE TOMCAT VERTIONS NOT SHOWING IN ECLIPSE SERVER RUNTIME ENVIRONMENTS (KEPLER/LUNA INSTRUCTIONS)
Following are the steps to install Apache Tomcat and add it into Eclipse Kepler or Luna:
- In Eclipse Kepler, go to Help, select ‘Install New Software’
- Choose “Kepler- http://download.eclipse.org/releases/kepler” site or add it in if it’s missing. If you’re using Luna, choose “Luna – http://download.eclipse.org/releases/luna” site or add it in if it’s missing
- Expand “Web, XML, and Java EE Development” section
- Check JST Server Adapters and JST Server Adapters Extensions
- Once installed, in Eclipse, go to Window / Preferences / Server / Runtime Environments
- Press Add button, select Apache / Apache Tomcat v7.0 or Apache Tomcat v8.∞
- Press Next, select location on the drive (i.e. c:\apachetomcat) for Tomcat installation directory. Make sure that the directory exist.
- Then press ‘Download and Install’ button, accept terms and point to your installation directory (i.e. c:\apachetomcat) and press OK button
- Apache TomCat v7.0 will install (you’ll see a progress in the status bar
- Press Finish.
- Apache Tomcat v7.0 or Tomcat v8.0 (depending on your selection) will show in the list under Server Runtime Environments now.
Labels:
eclipse
Saturday, 1 November 2014
How to Install Oracle Java 8 In Ubuntu
Step 1: Install Java 8 (JDK 8)
Add the webupd8team java PPA repository in our system and install Oracle java8 using following set of commands.
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
Step 2: Verify JAVA Version
After successfully installing oracle java using above step verify installed version using following command.
$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Step 3: Setup JAVA Environment
Webupd8team is providing a package to set environment variables, Install this package using following command.
$ sudo apt-get install oracle-java8-set-default
How To Install Java on Ubuntu
Installing default JRE/JDK
This is the recommended and easiest option. This will install OpenJDK 6 on Ubuntu 12.04 and earlier and on 12.10+ it will install OpenJDK 7.Installing Java with apt-get is easy. First, update the package index:
sudo apt-get update
Then, check if Java is not already installed:
java -version
If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:
sudo apt-get install default-jre
This will install the Java Runtime Environment (JRE). If you instead need the Java Development Kit (JDK), which is usually needed to compile Java applications (for example Apache Ant, Apache Maven, Eclipse and IntelliJ IDEA execute the following command:
sudo apt-get install default-jdk
That is everything that is needed to install Java.
All other steps are optional and must only be executed when needed.
Installing OpenJDK 7 (optional)
To install OpenJDK 7, execute the following command:
sudo apt-get install openjdk-7-jre
This will install the Java Runtime Environment (JRE). If you instead need the Java Development Kit (JDK), execute the following command:
sudo apt-get install openjdk-7-jdk
Installing Oracle JDK (optional)
The Oracle JDK is the official JDK; however, it is no longer provided by Oracle as a default installation for Ubuntu.
You can still install it using apt-get. To install any version, first execute the following commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Then, depending on the version you want to install, execute one of the following commands:
Oracle JDK 6
This is an old version but still in use.
sudo apt-get install oracle-java6-installer
Oracle JDK 7
This is the latest stable version.
sudo apt-get install oracle-java7-installer
Oracle JDK 8
This is a developer preview, the general release is scheduled for March 2014. This external article about Java 8 may help you to understand what it's all about.
sudo apt-get install oracle-java8-installer
Managing Java (optional)
When there are multiple Java installations on your Droplet, the Java version to use as default can be chosen. To do this, execute the following command:sudo update-alternatives --config java
It will usually return something like this if you have 2 installations (if you have more, it will of course return more):
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 manual mode
Press enter to keep the current choice[*], or type selection number:
You can now choose the number to use as default. This can also be done for the Java compiler (javac):
sudo update-alternatives --config javac
It is the same selection screen as the previous command and should be used in the same way. This command can be executed for all other commands which have different installations. In Java, this includes but is not limited to: keytool, javadoc and jarsigner.
Setting the "JAVA_HOME" environment variable
To set the JAVA_HOME environment variable, which is needed for some programs, first find out the path of your Java installation:
sudo update-alternatives --config java
It returns something like:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 manual mode
Press enter to keep the current choice[*], or type selection number:
The path of the installation is for each:
/usr/lib/jvm/java-7-oracle
/usr/lib/jvm/java-6-openjdk-amd64
/usr/lib/jvm/java-7-oracle
Copy the path from your preferred installation and then edit the file /etc/environment:
sudo nano /etc/environment
In this file, add the following line (replacing YOUR_PATH by the just copied path):
JAVA_HOME="YOUR_PATH"
That should be enough to set the environment variable. Now reload this file:
source /etc/environment
Test it by executing:
echo $JAVA_HOME
If it returns the just set path, the environment variable has been set successfully. If it doesn't, please make sure you followed all steps correctly.
Tuesday, 9 September 2014
Switching between installed Java versions in ubuntu
Switching between installed Java versions can be accomplished using the update alternatives command.
- To get a list of your installed Java platforms, run the following command from the terminal:
sudo update-alternatives --config java
This will give you a list output similar to this:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-6-oracle/jre/bin/java 1070 auto mode
1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode
* 2 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1069 manual mode
Press enter to keep the current choice[*], or type selection number:
In this case, the Open JDK 6 version is running. To switch to the Open JDK version 7, you would select option 1 at the prompt and press the Enter key.
You will now be running the OpenJDK 7 version. No other changes will be needed to switch your Java versions.
Saturday, 30 August 2014
Temporarily disable Eclipse plugins in load-on-startup
Temporarily disable Eclipse plugins in load-on-startup
Eclipse :Windows-->Preferences-->General-->Startup and Shutdown
De-select unwanted plugins.
Select Apply-->Ok.
Eclipse :Windows-->Preferences-->General-->Startup and Shutdown
De-select unwanted plugins.
Select Apply-->Ok.
Labels:
eclipse
Thursday, 3 July 2014
Thursday, 19 June 2014
How do upgrade GWT in Eclipse
How do upgrade GWT in Eclipse
- Download the GWT SDK(s) you need from https://developers.google.com/web-toolkit/versions
- Extract it anywhere you like
- In Eclipse Preferences > Google > Web Toolkit, use the "Add..." button and navigate to the GWT SDK directory
- Then, in each Eclipse project's properties page (Project > Properties > Google > Web Toolkit), you can choose one of your installed SDKs.
Labels:
GWT







