Tuesday, March 23, 2010

MySql DB commands

for mysql : create database test; grant all on test.* to test@'localhost' identified by 'test'; grant all on test.* to test@'%' identified by 'test'; to run scripts in mysql mysql> source <path to sql file> MySql export schema without data mysqldump -u root -p --no-data dbname > sc...

Friday, March 19, 2010

Send and Receive files from remote system

Send and receive files from java socket programing Sender : 1. Create a Scoket connection ServerSocket servsock = new ServerSocket(13267); 2. Checks for the socket acceptence from socket client Socket sock = servsock.accept(); 3. Stream the file and output the stream Receiver : 1. Create socket...

WebServiceClient test code

Following is the sample test code to test the webservice import javax.xml.rpc.Call; import javax.xml.rpc.Service; import javax.xml.namespace.QName; public class TestClient {   public static void main(String [] args) {     try {       String endpoint = "http://localhost:8080/axis/test.jws";      ...

Saturday, March 13, 2010

JVM_PermGen-space

Java virtual machine has Four generations : eden, young, old and permanent. In the eden generation, objects are very short lived and garbage collection is swift and often. The young generation consists of objects that survived the eden generation (or was pushed down to young because the eden generation...

Wednesday, March 3, 2010

Hide windows Task bar java JNI

See my previous post on javaJNI sample imlpementation for basic info. Now how to hide the user menu in windows system, user functionalities are in user32.dll file of windows. Hide task bar 1. write a java class for native method or dll loading public class WindowLock {        ...

java JNI sample implementation

1. First create A simple java class. public class HelloWorld { public native void Hello(); static { System.load("C:/test.dll"); System.out.println("Loaded"); } public static void main(String[] args) { new HelloWorld().Hello(); } } use load() insted of loadlibrary() and give the absolute path of...