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...
Tuesday, March 23, 2010
Generate Webservice proxy classes or client stub classes by MAVEN
Add the following plugin and dependencies
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.3</version>
<configuration>...
Generate Webservice proxy classes or client stub classes by ANT
For ANT build :
set the <taskdef> for axis-wsdl2java
<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
Axis taskdefs :
axis-wsdl2java=org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask
axis-java2wsdl=org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask
create...
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
Clustering or LoadBalancer configuration with apache web server
install Apache HTTP Server2.2.11 web server.
Once the installation starts follow the steps as shown in following figures.
Configuration of Web server ...
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...