Thursday, 17 March 2016

Extract and Create a jar file from command prompt

Extract and Create a jar file from command prompt

Extract :
Take a jar file, from that location in command prompt and just run "jar xf filename.jar"
Ex: C:\Java> jar xf myFile.jar
This will extract the jar and saves to the folder.


Create :
Take a folder containg file, just run a command line "jar cf jarName.jar folderName"
Ex: C:\Java> jar cf myJar.jar myfile
This will create a jar file containing myfile.

Thanks,
Amar

Important Links

Links to refer:

File DownoadJava code geeks

Zip/Unzip File : mkyong

Html creation from URLmkyong

Creating a directorymkyong stack over flow

Upload filejava

Excel creation blog

Spring Web service Blogger brian's


InputStream fis = new FileInputStream(filenameInServer_fileObject);
res.setContentType("application/octet-stream");
res.setContentLength((int) fileObject.length());
res.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");
       ServletOutputStream os = res.getOutputStream();
       byte[] bufferData = new byte[1024];
       int read=0;
       while((read = fis.read(bufferData))!= -1){
           os.write(bufferData, 0, read);
       }
       os.flush();
       os.close();
       fis.close();


Thanks,
Amar

Tuesday, 23 February 2016

Disable right click on html page

Just need to place a return false value to the oncontextmenu of the html tag.

Example: <html oncontextmenu="return false">

Thanks,
Amar

Tuesday, 16 February 2016

Oracle 11g db connect problem in local via command prompt

I have got the following error, upon providing user name and password in Oracle 11g console to connect db.

ERROR:ORA-12560: TNS:protocol adapter error

Solution:
The oracle service in local was in not running mode, so it was not finding the db to connect and which throws above error.

Below is the step to start the service in local,

Click on Start --> Run--> type " services.msc" click enter.

Select the OracleService name, right click and click start.

Now the oracle service wil be in running mode, so able to connect db.


Thanks,
Amar

Thursday, 11 February 2016

Welcome To My Blog!!!

A warm welcome to All,

This blog is to refer my self the way, i come across of my IT career in development area.

Hope it helps a few.

Thanks and Cheers,
Amar