Archive for December, 2008

My single test SWT vs Swing

Sunday, December 21st, 2008

code goes like this

[swt]

import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;

public class HelloWorld {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
int hunter = 0;
int house = 0;
for (int counter = 0; counter <= 400; counter++) {
Button b = new Button(shell, SWT.CENTER);
b.setText(counter+”");
b.setBounds(house, hunter, 40, 40);
hunter += 40;
if (hunter >= 600) {
hunter = 0;
house += 40;
}
}

// label.setText(”Hello, World”);
// label.setBounds(shell.getClientArea());
shell.open();
shell.setText(”what is this”);
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}

[swing]

import javax.swing.JButton;
import javax.swing.JFrame;

public class Swing {

public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setVisible(true);
frame.setLayout(null);
int hunter = 0;
int house = 0;
for (int counter = 0; counter <= 400; counter++) {
JButton b = new JButton();
b.setText(counter + “”);
b.setBounds(house, hunter, 50, 50);
frame.add(b);
hunter += 50;
if (hunter >= 600) {
hunter = 0;
house += 50;
}
}
}

}

Viewing memory taken in windows vista with jdk1.6 update 10

SWT takes about 10,160  KB
Swing takes about 16,429 KB

So i am planning to go with SWT and leave spring finally now

Thanks

With PL/JAVA

Saturday, December 20th, 2008

PostgreSQL is my boss’s choice as an alternative for high cost oracle. I have been making tests to find if it really suits our requirement .

Here is why i found out PG is better than MYSQL

1) The oracle like sequences
2) better java suport
3) writing stored procedures in java
4) better support for .net platform

Can oracle be replaced with PGSQL is still a question but what i conclude is with PL/java around PGSQL is always better option for Online transaction processing JAVA applications

Setting PL/JAVA under windows is bit tricky we need to have path set to the JAVA_HOME/jre/bin/client where jvm.dll reside and also to the path where there is pljava.dll

for giving the path of the jar files in postgre.conf we used \\ instead of using \ or / and java under pg is working great

Thanks

done with dainikee.com and myrepublica.com

Monday, December 8th, 2008

finally done with
dainikee.com and myrepublica.com

fun working..