Home Tutorialhelp Comment PGP decryption will work from Java1.5/1.6 cmd prom

 
 

Comment

Pramod
PGP decryption will work from Java1.5/1.6 cmd prom,
July 3, 2009 at 11:26 AM

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.NoSuchProviderException;
import java.security.Security;
import java.util.Iterator;

import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPCompressedData;
import org.bouncycastle.openpgp.PGPEncryptedDataList;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPLiteralData;
import org.bouncycastle.openpgp.PGPObjectFactory;
import org.bouncycastle.openpgp.PGPOnePassSignatureList;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKeyEncryptedData;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.bouncycastle.openpgp.PGPUtil;





public class Test {
private static File privateKeyFile = new File("Private Key path");

private static String privateKeyPassword = "Password/passphrase";

private static PGPPrivateKey findSecretKey(InputStream keyIn, long keyID, char[] pass) throws IOException, PGPException, NoSuchProviderException {
PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(PGPUtil.getDecoderStream(keyIn));
PGPSecretKey secretKey = pgpSec.getSecretKey(keyID);
if (secretKey == null) {
return null;
}
return secretKey.extractPrivateKey(pass, "BC");




}

public static String decrypt(byte[] encdata) {
System.out.println("decrypt(): data length=" + encdata.length);

try {
ByteArrayInputStream bais = new ByteArrayInputStream(encdata);
FileInputStream privKey = new FileInputStream(privateKeyFile);
return _decrypt(bais, privKey, privateKeyPassword.toCharArray());
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
return null;
}

private static String _decrypt(InputStream in, InputStream keyIn, char[] passwd) throws Exception {
in = PGPUtil.getDecoderStream(in);
try {
PGPObjectFactory pgpF = new PGPObjectFactory(in);
PGPEncryptedDataList enc;
Object o = pgpF.nextObject();
//
// the first object might be a PGP marker packet.
//
if (o instanceof PGPEncryptedDataList) {
enc = (PGPEncryptedDataList) o;
} else {
enc = (PGPEncryptedDataList) pgpF.nextObject();
}
//
// find the secret key
//
Iterator iterator = enc.getEncryptedDataObjects();
PGPPrivateKey privateKey = null;
PGPPublicKeyEncryptedData publicKeyEncryptedData = null;
while (privateKey == null && iterator.hasNext()) {
publicKeyEncryptedData = (PGPPublicKeyEncryptedData) iterator.next();
System.out.println("publicKeyEncryptedData id=" + publicKeyEncryptedData.getKeyID());
privateKey = findSecretKey(keyIn, publicKeyEncryptedData.getKeyID(), passwd);
}
if (privateKey == null) {
throw new IllegalArgumentException("secret key for message not found.");
}
System.out.println("my-alg:" + privateKey.getKey().getAlgorithm());
System.out.println("private key" + privateKey.toString());
InputStream inputStream = publicKeyEncryptedData.getDataStream(privateKey, "BC", "BC");
PGPObjectFactory objectFactory = new PGPObjectFactory(inputStream);
Object message = objectFactory.nextObject();
if (message instanceof PGPCompressedData) {
PGPCompressedData cData = (PGPCompressedData) message;
PGPObjectFactory pgpFact = new PGPObjectFactory(cData.getDataStream());
message = pgpFact.nextObject();
}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
if (message instanceof PGPLiteralData) {
PGPLiteralData pgpLiteralData = (PGPLiteralData) message;
InputStream unc = pgpLiteralData.getInputStream();
int ch;
while ((ch = unc.read()) >= 0) {
byteArrayOutputStream.write(ch);
}
} else if (message instanceof PGPOnePassSignatureList) {
throw new PGPException("encrypted message contains a signed message - not literal data.");
} else {
throw new PGPException("message is not a simple encrypted file - type unknown.");
}
if (publicKeyEncryptedData.isIntegrityProtected()) {
if (!publicKeyEncryptedData.verify()) {
System.err.println("message failed integrity check");
} else {
System.err.println("message integrity check passed");
}
} else {
System.err.println("no message integrity check");
}
return byteArrayOutputStream.toString();
} catch (PGPException e) {
System.err.println(e);
if (e.getUnderlyingException() != null) {
e.getUnderlyingException().printStackTrace();
}
}
return null;
}

public static void main(String[] args) throws IOException {
Security.addProvider(new BouncyCastleProvider());
byte[] newB = null;
try {
FileInputStream fileInputStream = new FileInputStream("encrypted file");
newB = new byte[fileInputStream.available()];
System.out.println("read bytes: " + fileInputStream.read(newB));
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("byte array" + newB.length);
// ----- Decrypt the token that
String result = decrypt(newB);
FileOutputStream decryptedFile = new FileOutputStream("C:/new.txt");

while(result.length()!= -1)
{
decryptedFile.write(result.getBytes());
}

System.out.println("Decrypted: " + result);
}

}

Copy the bc jar files into jre/ext directory and copy jce_policy jars into jre/lib/security folder

It works....
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

Java at cmd
Java at cmd  How to display all built in methods of any java class at the cmd? using which command? For example how to Display built-in methods of String class at cmd.. help me   Command is: javap Suppose, you want 

Java Beginners

io
io  write a program in java to accept a filename from user and print its content on the monitor   Hello Friend, Try the following code: import java.io.*; import java.util.*; class DisplayContentOfFile { public 

Java-Tutorials

Java IO Path
Java IO Path In this section we will discuss about the Java IO Path. Storage... called the delimiter. The file separator varies from O/S to O/S for example... without complete information. To work with Path in Java, the Path class 

Java Beginners

cant call cmd from java - Java Beginners
cant call cmd from java   How can I call this from java to be executed by cmd ? ConvertXLS.EXE /S "C:\Extracto\*.CSV"/T "C:\Extracto\*.XLS" /C-4143 /F6 /M2 /R /V 

Programming Tutorials

Working With File,Java Input,Java Input Output,Java Inputstream,Java io Tutorial,Java io package,Java io example
; In the previous chapter, we learned how to work with the streams. which... to work with a file using the non-stream file I/O. The File class is used... it, deleting it, reading from or writing to it. The constructors of the File class 

Java Beginners

java binary file io example
java binary file io example  java binary file io example 

Java Beginners

Encryption Decryption In Scriptlets/Java
Encryption Decryption In Scriptlets/Java  I have this code in my... successfully, now when I get my encrypted data from my DB, specifically MSSQL.. I traced where the program stopped working and it stopped in the decryption part and I get 

Java Beginners

io
io  create a meanu based text editor in java having features of creating file,viewing file,deleting file,renaming file,copying file and cutting file 

Java Beginners

IO in java
IO in java  Your search mechanism will take as input a multi-word query and will return a list of documents where the given words appear. 1. Your... the words specified appear closer to one another. For example, if you search 

Java Beginners

java io
java io  Write a program to use a File object and print even numbers from two to ten. Then using RandomAccessFile write numbers from 1 to 5. Then using seek () print only the last 3 digits 

Java Beginners

read from cmd syntax and open the file
read from cmd syntax and open the file  i have to read the name of the database e.g., "database.txt" file from a cmd syntax and open it: java FindKeys database=db.txt;minjoinrows=integer|all how can i do 

Java Beginners

read from cmd syntax and open the file
read from cmd syntax and open the file  i have to read the name of the database e.g., "database.txt" file from a cmd syntax and open it: java FindKeys database=db.txt;minjoinrows=integer|all how can i do 

Java Beginners

CORE JAVA CMD
CORE JAVA CMD  How to run cmd command in jsp 

Java Beginners

AES decryption in Java
AES decryption in Java   AES decryption in Java with password.../viewqa/Java-Beginners/26020-AES-Decryption-using-key-password-.html    http://www.roseindia.net/answers/viewqa/Java-Beginners/26020-AES-Decryption 

Java Beginners

IO File - Java Beginners
IO File  Write a java program which will read an input file & will produce an output file which will extract errors & warnings. It shall exclude... from the log file. This is the task assigned to me..Please help me 

Java Beginners

Import java IO - Java Beginners
Import java IO  for example i know java IO is for input and output. I am using Netbeans5.5.1. How can i see all the classes related to java IO for example; stream reader, buffer reader 

Java Beginners

decryption and encryption - Java Beginners
decryption and encryption  hi everyone. my question is that i have one problem which i have to solve and the issue is that i have to do the encryption and decryption thing there in my code, e.g if the user enters the abc the code 

Java Beginners

cmd in c++/JAVA - Java Beginners
cmd in c++/JAVA  HI , CAN U TELL ME THAT HOW I CAN MAKE THE COMMAND FOR DOS IN C++ OR JAVA....? eg.:-COPY,COPYCON,DELETE,FORMAT,DATE ETC. PLZ TELL ME WHERE I CAN LEARN THE SYSTEM PROGRAMMING ,AND DOS GAMES ETC. PLEASE 

Java Beginners

io - Java Beginners
io  how to give the input like integer data,float data from the keyboard pls give me the information along with the example  Hi friend.... http://www.roseindia.net/java/ Thanks Amardeep 

Java Beginners

java io - Java Beginners
Java IO Streams  What is the Java IO Stream 

Java Beginners

Encryption and Decryption - Java Beginners
Encryption and Decryption  Hello sir, i need Password encryption and decryption program using java program. I dont know how to write the program... the source code of encyption and decryption using java. Thanking you...  

Java-Tutorials

How to run a Java program in CMD
There are multiple ways to write and run Java programs. In this article we discussed how to write and run Java program in CMD. Tips to run Java program... a notepad or any other editor and write a small program in Java as given below 

Java Beginners

encryption and decryption - Java Beginners
encryption and decryption  i need files encryption and decryption program using java. but i dont know how to write the program.pls help me thank you so much  Hi Friend, Try the following code: import java.io. 

Java Beginners

java io
java io  by using java coding how to invoke a particular directory 

Java Interview Questions

Java IO
Java IO  What an I/O filter 

Java Beginners

java IO
java IO  Write a Java program to accept a file name as command line argument. Append the string "File Modified by Programme" to the end of the same file and print the contents of the modified File 

Java-Tutorials

Java IO StringReader
Java IO StringReader In this section we will discuss about the StringReader class in Java. StringReader class reads the string from the input stream... of methods( either inherited from its super class or of itself) to do work 

Java Beginners

io packages - Java Beginners
io packages  How can I add two integers in java using io pacages 

Java-Tutorials

Java IO InputStream Example
Java IO InputStream Example In this section we will discuss about the InputStream in Java. An abstract class InputStream is a base class of all the byte...() : returns the number of readable bytes from the input stream. public int 

Java Beginners

java IO programing
java IO programing  how Java source file is used as input the program will echo lines 

Java-Tutorials

Java IO FilterWriter
Java IO FilterWriter In this example we will discuss about the FilterWriter...(); bw.write("Java IO FilterWriter Example"); System.out.println("Data is written... an example is being given which demonstrates about how to use Java FilterWriter 

Java Beginners

IO concept
IO concept  Write a java program that moves the contents of the one file to another and deletes the old file.   Hi Friend, Try...!"); } } For more information, visit the following link: Java Move File Thanks 

Java Beginners

Help Me in My Java Work
Help Me in My Java Work  Can you help me please... Write a Java... for individual marks are given below: (i) A mark ranging from 90 to 100% is awarded a GPA of 4.0 (ii) A mark ranging from 80 to 89%: is awarded a GPA of 3.5. (iii 

Java-Tutorials

Java IO SequenceInputStream Example
Java IO SequenceInputStream Example In this tutorial we will learn about... by the stream. read() : This method is used to read the bytes from the input stream... the specified length 'len' of bytes from the specified byte array 'b' 

Java Beginners

java-io - Java Beginners
java-io  Hi Deepak; down core java io using class in myn...://www.roseindia.net/java/java-conversion/two-dimensional-array-program-using-nested-loop.shtml http://www.roseindia.net/java/beginners/SquareMatrix.shtml Thanks 

Java-Tutorials

Java FileOutputStream Example
Java FileOutputStream Example In this section we will discuss about the Java IO FileOutputStream. FileOutputStream is a class of java.io package which... the text read from the abc.txt file will be written. Now created a Java class named 

Spring Framework

Spring IO Platform 1.0.0 Released
Java EE making it more useful.   It can work with the existing...Spring IO Platform 1.0.0 Released - Check the new features of this release The Spring IO is platform for developing and building the modern day applications 

Java-Tutorials

Java IO FileReader
Java IO FileReader In this tutorial we will learn about the FileReader class... you about how to use java.io.FileReader. In this example I have created a Java... of this example can be downloaded from the link given below. The downloaded file 

Java-Tutorials

Java IO OutputStreamWriter
"); bw.newLine(); bw.write("Java IO OutputStreamWriter Example...Java IO OutputStreamWriter In this section we will learn about the Java..."); osw = new OutputStreamWriter(os); osw.write("Java IO 

Java-Tutorials

Java IO CharArrayReader
Java IO CharArrayReader In this tutorial we will learn about the CharArrayReader class in Java. CharArrayReader class in java.io package provides... the stream of char array. In this example I have created a Java class to read 

Java-Tutorials

Java IO PipedWriter
Java IO PipedWriter In this tutorial we will learn about the PipedWriter in Java. java.io.PipedWriter writes the characters to the piped output stream.... This example explains how to write a specified length of characters started from 

Java-Tutorials

Java IO FilterReader
Java IO FilterReader In this section we will learn about the FilterReader class in Java. java.io.FilterReader is an abstract class provides the facility... the specified length of character at the specified position from a specified char 

Java-Tutorials

Java IO StringWriter
Java IO StringWriter In this section we will discussed about the StringWriter... in the Java program. In this example I have created a Java class named...[]) { String str = "Java StringWriter Example"; try 

Java-Tutorials

Java IO BufferedReader
Java IO BufferedReader In this section we will discuss about the BufferedReader class in Java. BufferedReader class in java.io package is used for read... from buffer. In this example I have used a BufferedReader with the default size 

Java-Tutorials

Java IO LineNumberReader
Java IO LineNumberReader In this tutorial we will learn about the LineNumberReader in Java. java.io.LineNumberReader class extends... of text. In this example line of text will be read from the file and displayed 

Java-Tutorials

Java IO Reader
Java IO Reader In this section we will discuss about the Reader class in Java... and how the characters can be read from the stream. In this example I have created... descended from this class may overrides the methods of this class but the method 

Java-Tutorials

Java IO PipedReader
Java IO PipedReader In this section we will discuss about the PipedReader in Java. java.io.PipedReader reads the characters from pipe. java.io.PipedWriter... by the PipedWriter. To read the characters from the pipe PipedReader is required 

Java-Tutorials

Java Io BufferedWriter
Java IO BufferedWriter In this section we will discuss about the BufferedWriter class in Java. java.io.BufferedWriter class extends the java.io.Writer class. BufferedWriter class is used to write to the stream from buffer. Generally 

Java-Tutorials

Java IO InputStreamReader
Java IO InputStreamReader In this section we will discuss about the InputStreamReader in Java. java.io.InputStreamReader class takes input as a byte... is used to read characters from the stream. For efficiency, it is advised 

Java-Tutorials

Java IO Writer
Java IO Writer In this section we will discuss about the Writer class in Java... of the above example can be downloaded from the link given below. Download Source... in or to facilitate to write (output) the character streams. Classes descended from this class 

Java Beginners

Simple IO Application - Java Beginners
Simple IO Application  Hi, please help me Write a simple Java application that prompts the user for their first name and then their last name. The application should then respond with 'Hello first & last name, what 

Java-Tutorials

Java IO PushbackReader
Java IO PushbackReader In this section we will discuss about the PushbackReader class in Java. PushbackReader is a class of java.io package that extends.... In this example I have created a simple Java class named 

Java-Tutorials

Java ByteArrayOutputStream Example
Java ByteArrayOutputStream Example In this section we will discuss about the Java IO Byte Streams ByteArrayOutputStream. ByteArrayOutputStream... length of byte from the specified byte array started from the specified offset 

Java-Tutorials

Java IO CharArrayWriter
Java IO CharArrayWriter In this tutorial we will learn about the CharArrayWriter in Java. java.io.CharArrayWriter extends the java.io.Writer.... started from offset 'off'. Syntax : public void write(char[] c, int 

Java Beginners

How to run program in new opened cmd
How to run program in new opened cmd  Hello i have made a program in java to open command prompt, then how to run my left of the program in the new opened command prompt 

Java-Tutorials

Java IO PrintWriter
Java IO PrintWriter In this tutorial we will learn about the the PrintWriter... the PrintWriter in the Java applications. In this example I have created... the output as follows : Source code of this example can also be downloaded from 

Java-Tutorials

Java IO OutputStream
Java IO OutputStream In this section we will read about the OutputStream class... array started from the specified offset (off) to the output stream. public...) throws IOException   Example : An example 

Java-Tutorials

Java FileInputStream
Java FileInputStream In this section we will discuss about the Java IO... for reading the input bytes from a file. An InputStream is a super class... be read or skipped over from the input stream. Syntax : public int available 

Java Beginners

Difference between Java IO Class - Java Beginners
Difference between Java IO Class  What is the difference in function between Two set of Stream class as mention below- 1)FileInputStream... information. http://www.roseindia.net/java/ Thanks 

Java Beginners

jvm work
jvm work  wht is the work of jvm? deaply.   Hi Friend, Java Virtual Machine or JVM for short is a software execution engine to run the java programs. Java Virtual Machine is also known as "Java Interpreter" which 

Java-Tutorials

Java I/O Object Streams
Java I/O Object Streams In this section we will discuss the Java IO Object Streams. To work with the I/O of objects Java provided the support of Object... data types and graphs of Java objects into an output stream. This class can 

Java-Tutorials

Read Text from Standard IO
Reading Text from the Standard Input   ... from the keyboard and write output to the display. They also support I/O operations on files.  Java also supports three Standard Streams 

Java Beginners

core java ,io operation,calling methods using switch cases
core java ,io operation,calling methods using switch cases  How to create a dictionary program,providing user inputs using io operations with switch cases and providing different options for searching,editing,storing meanings 

Java Beginners

How java work on Unicode machanish
How java work on Unicode machanish   How the data are stored in java as unicode, how the conversions is done for input/output stream. Please describe in detail with memory aspect 

Java Beginners

Getting Current Directory from java - Java Beginners
://www.roseindia.net/java/java-get-example/get-CWD.shtml http://www.roseindia.net/java/example/java/io/GetCurrentDir.shtml Thanks...Getting Current Directory from java  I'm designing an application 

JSP Servlet Questions

Password encryption and decryption
{ Statement st=con.createStatement(); ResultSet rs=st.executeQuery("Select * from user 

Java Beginners

How to read the data in text file seperated by by ',' in java using IO Operations
How to read the data in text file seperated by by ',' in java using IO Operations  in Text file data like raju 45,56,67 ramu 46,65,78 raji 34,23,56 this is the student marks in text file.this data read and calculate 

Java Technology Tutorials

Java Example Codes and Tutorials
Java Tutorials - Java Example Codes and Tutorials Java is great programming...; Java Break Example... Java conversion tutorials with example.   

Ajax Questions

How to work with Ajax in spring
How to work with Ajax in spring  give some sample code for ajax with spring (example like if i select a state from one drop down in another drop down related districts should come 

JDBC Questions

Insert option does not work in my jstl... - JDBC
Insert option does not work in my jstl...  I have problem with this jstl code... This will extract and displays details from xml... But i cant able... java herbert 

Java Beginners

How does the Java for each loop work?
How does the Java for each loop work?  How does the Java for each loop work 

Java Beginners

Collection frame work - Java Beginners
 

Java Beginners

OFbiz frame work - Java Beginners
 

Java Beginners

JFreeChart dosn't work
it, an error occurs (i tried an example from here, with XY, and it didn't work either) I... chart from JFreechart, but I just can't get it to work. The graph get its data from at 2-columun database (String, double). (The string is a date, represented 

General

Find Type of Work Book
Find Type of Work Book     ... of  workbook using POI3.0 API Event. The methods used in this example:  getSid(): This method is used to give the description  copied  from 

Java Beginners

How to write file from inputstream in java
How to write file from inputstream in java  Hi, how to write file from inputstream in java program. Plz suggest an example or suggested link... link to your query "How to Write to inputStream in Java". This is good 

JSP Servlet Questions

How to Work - JSP-Servlet
doing final year project using java,jsp,servlet.i only know java.i want details... model database program with where we save that program using jsp,servlet,java...; Hi friend, JSP : Java Server Pages or JSP for short is Sun's solution 

Java-Tutorials

Command Line Standard Input In Java
Command Line Standard Input In Java In this section we will discuss about the Java IO Standard Input through Command Line. Standard streams, feature.... In this example I have created a Java class named JavaSystemInExample.java into which I 

Security Questions

PGP implementation - Security
PGP implementation  Hi sir, I have encounterd problem in writing the code for the PGP implementaion with mail compatibility,encrypting the messages.Can you provide the code for the PGP.It is very urgent 

General

The J2EE Architecture allows the programmers to divide their work into two major categories Business Logic Presentation
the programmers to divide their work into two major categories.... Let's took an example of form processing. In this example... to input the data, a servlet to receive the data from the form 

Core Java

Example of HashSet class in java
Example of HashSet class in java. In this part of tutorial, we... unique. You can not store duplicate value. Java hashset example. How.... Example of Hashset iterator method in java. Example of Hashset size() method 

Java Beginners

How to delete a character from a file in java - Java Beginners
/beginners/ http://www.roseindia.net/java/example/java/io/ Thanks   I...How to delete a character from a file in java  I'm not gettting how to remove a character from a file in java....could any one help me out??  

Java-Tutorials

Command Line Standard Output In Java
Command Line Standard Output In Java In this section we will discuss about the Command Line Java IO Standard Output. Standard streams, feature of various O... at the console or any other dstination. In this example I have created a Java 

Java Beginners

Java FTP Client Example
Java FTP Client Example  How to write Java FTP Client Example code? Thanks   Hi, Here is the example code of simple FTP client in Java which downloads image from server FTP Download file example. Thanks 

Java-Tutorials

Command Line Standard Error In Java
Command Line Standard Error In Java In this section we will discuss about the Command Line Java IO Standard Error. System.out and System.err both.... In this example I have created a Java class named JavaSystemErrExample.java. 

General

Matrix Example in Java
Matrix Example in Java       This Java programming tutorial you how you can work...() method. Here is the code of this Example:   class  

Programming Tutorials

ajax example
in using DOJO for AJAX purpose From the HellowWorld example Hello... example doesn;t work - Ajax Ajax example doesn;t work  Hello every...Ajax Example Here is the list of few Ajax examples at RoseIndia.net. Ajax 

Java Beginners

FTP Java example
FTP Java example  Where is the FTP Java example on your website? I am... examples of FTP at: FTP Programming in Java tutorials with example code. Thaks... functionality in my Java based application. My application is swing based and I have 

Core Java

Multithreading Example In Java
Multithreading Example In Java In this section we will learn about multithreading in Java. Multithreading in Java is used to execute multiple tasks at the same time or parallel. Support of Multithreading in Java allows to process 

Java Beginners

freemarker example - Java Beginners
an example for freemarker. i want to get the values from java and display those values in the page designed using freemarker(how to get the values from java). and please provide an example with code and directory structure. send me ASAP 

JDBC Questions

How does this example work even if no oracle to be used and only access is available?
How does this example work even if no oracle to be used and only access is available?  CONNECTION CLASS package ExamplePackage; import java.sql.... searchQuery = "select * from users where username 

Java-Tutorials

Using a Random Access File in Java
C:\nisha>javac RandAccessFile.java C:\nisha>java... Successfully Download this example. The another program reads the characters from a file using the readByte( ) method 

Java Interview Questions

java - Java Interview Questions
://www.roseindia.net/java/example/java/io/SerializingObject.shtml http://www.roseindia.net/java/example/java/io/DeserializingObject.shtml Thanks... an object from a byte stream to the same state in which the object was previously 

Java-Tutorials

Java IO File
Java IO File In this section we will discuss about the File class in Java..., numbers etc and may arranged in string, rows, columns, lines etc. In Java we can also create a File to store the data. To create file in Java a class named 

Hibernate Tutorial Example

HQL from clause Example
HQL from clause Example       In this example you will learn how to use the HQL from clause. The from clause is the simplest possible Hibernate Query. Example of from 

JDBC

JDBC Select Count example
JDBC Select Count example In this tutorial  we will learn how work COUNT... NULL values. Table of user : Mysql query  "SELECT COUNT(*) FROM... = "SELECT COUNT(*) FROM user"; ResultSet rs=stmt.executeQuery(query 

Java Beginners

Example Code - Java Beginners
Example Code  I want simple Scanner Class Example in Java and WrapperClass Example. What is the Purpose of Wrapper Class and Scanner Class . when i...,string,double,float values from the command prompt. Example of Scanner class 

Java Beginners

Java File Management Example
of file. Read the example Read file in Java for more information on reading...Java File Management Example  Hi, Is there any ready made API in Java for creating and updating data into text file? How a programmer can write code 

Java Beginners

Java search from sqlservr
Java search from sqlservr  Hi I am a newbie to java . I know there are a lot of example on search functionality from Db , but can some please help me to implement search functionality where sql server is backend. Thanks   

Java Beginners

Create PDF from java
code to create pdf file from database call from java programming. thank you, Hendra   Create PDF from Java import java.io.*; import java.sql....Create PDF from java  Good afternoon, I have a problem how to create 

Advertisements Advertisements
 

 

 

DMCA.com