Archive for the ‘Java’ Category

Combination Generator in Java

combination genarator
A combination is an unordered collection of unique size. For example, if a list contains four numbers ( 1, 2, 3, 4 ), its combination of an unordered collection of unique size will be, , , , , , , , , , , , , , , . In shortly, Number of ways of selecting zero or more things from 'n' different things is given ... Full story

How to install multiple JVM in Linux

jvm
1.Verify your current java version #java -version java version "1.4.2" gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 2.Then use alternatives command to display existing java NOTE:alternatives command used to maintain symbolic links for determining default commands Full story

Convert Sql date to String Date

sql date
public class DateExample { public static void main(String args[]){ SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");//Date format String date=null; java.util.Date utilDate=new java.util.Date(sqlDate.getTime());// your Sql date value date=formatter.format(utilDate); System.out.println("String date "+date); } } Full story

How to convert string date to sql date in java using java.util.Date

Java Logo
public class stringToSqlDate { public static void main(String args[]){ String strDate="17/12/2010"; java.util.Date dt=new java.util.Date(strDate); java.sql.Date sqlDate=new java.sql.Date(dt.getTime()); System.out.println(sqlDate); } Full story

How to get Current TimeStamp in Java

timestamp
The following code returns the java.sql.Timestamp which represents the current TimeStamp Here, to get the TimeStamp, i created a calender object by Calendar.getInstance(); Then using that object retrieve the time of from java.util.Date and convert that value to java.sql.Timestamp. The following code returns java.sql.Timestamp Full story

How to get System IP address in java

lan
To get system IP Address in Java , using java.net.InetAddress; This class represents an Internet Protocol (IP) address.An IP address is either a 32-bit or 128-bit unsigned number used by IP, a lower-level protocol on which protocols like UDP and TCP are built. public static InetAddress getLocalHost()throws UnknownHostException Here,If there is a security manager, its checkConnect method is called with the local host name and -1 ... Full story

Set form size according to the screen resolution

java
Screen resolution is varying from one system to another. So to fit your form size depends on the screen resolution the following code is used. Here first take the screen size and set that size to your panel. Full story

How to Get JPG from rectangle Using Robot Class

swing-logo
Java.awt.Robot class is used to take the control of mouse and keyboard. Once you get the control, you can do any type of operation related to mouse and keyboard through your java code. This class is used generally for test automation. Full story

Inverse in hibernate ? what do you mean by inverse=true in hibernate?

hibernatelogo
Inverse defines which side is responsible of the association maintenance. The side having inverse="false" (default value) has this responsibility (and will create the appropriate SQL query - insert, update or delete). Changes made to the association on the side of the inverse="true" are not persisted in DB. Full story

How to configure eclipse to develop android applications

Download the Android SDK from Android site. Extract the zip file to /usr/local/android (to any path).Then in Eclipse open the Preferences from Windows tab.Select Android and enter the SDK location . /usr/local/android in our case. Full story
Copyright © 2012 CoreTimer.com|System Admin’s Reference. All rights reserved.

Switch to our mobile site