Wednesday 30 July 2008

Eclipse- Show suggestion word , line number

Eclipse setup
*==== show line number ====*
Window > Preferences > General > Editors > Text Editors > "Show line numbers"


*==== show suggestion word =====*
Window > Preferences > Java > Editor > Context Assist > Advanced >
check all check box "Select the proposal kinds contained in the 'default' content assist list

Tuesday 29 July 2008

eclipse- Proxy Server Setting 2

Window > Property > Internet > Proxy

IP : 10.88.193.132
Port :3128

Tuesday 22 July 2008

Spring osgi - good tutorial

http://springosgi.googlepages.com/

If you have the problem while you are following the example from the site, please
use different pom.xml file.


When you progress the sample from the tutorial site, please use another pom.xml file.

updated pom.xml file

Wednesday 16 July 2008

Install SpringIDE or Maven in Eclipse 3.4 ( GANYMEDE )

1. Help
2. Software update
3. Add Site
4. Enter http://springide.org/updatesite
4-1. For Maven - http://m2eclipse.sonatype.org/update/
5. Click checkbox next to http://springide.org/updatesite to expand.
5-1 For Mave - http://m2eclipse.sonatype.org/update/ to expand
6. Check all sub option under SpringIDE (Maven)
7. Install
8. You will have below error message
======================================================
The software items you selected may not be valid with your current installation....
===================================================
9. Click Yes
10. Uncheck
"Spring IDE Dependencies (only for Eclipse 3.2.x)"
"Spring IDE Mylyn Integration (optional)"
10-1 "Subclipse Integration for Maven (Optional)"
11. Click Next

Tuesday 15 July 2008

JSON : Array List <> JSON 2

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;


public class testMain {

/**
* @param args
*/
public static void main(String[] args) {

MyBean myBean = new MyBean();
myBean.setId(1);
myBean.setName("one");
MyBean myBean2 = new MyBean();
myBean2.setId(2);
myBean2.setName("two");

List mybeanList = new ArrayList();
mybeanList.add(myBean);
mybeanList.add(myBean2);

JSONArray jsonArray = JSONArray.fromObject(mybeanList);
System.out.println("mybean list -----"+jsonArray);

Map map0 = new HashMap();
map0.put("success", true);

JSONObject mapObject = JSONObject.fromObject(map0);
System.out.println("map0 - "+mapObject);

Map map = new HashMap();
map.put("data", jsonArray);

JSONObject jsonObject = JSONObject.fromObject(map);
System.out.println("json - "+jsonObject);

}

}

Thursday 10 July 2008

php + mysql : development enviroment setup

* Setup PHP enviroment under window OS System

http://blog.naver.com/jjeowl?Redirect=Log&logNo=40025454157


After you setup
please test with under example php file
=== connectTest.php ====


$dbhost = "localhost";
$dbname = "test";
$dbuser = "root";
$dbpass = "1111";

$conn = @mysql_connect($dbhost,$dbuser,$dbpass);
if($conn)
{
if(!@mysql_select_db($dbname,$conn))
{
echo "DB Select Error!";
exit();
}else{

echo "Success connection !";

}
}
else
{
echo "DB Connection Error!";
exit();
}

?>

Monday 7 July 2008

JSON : Array List <> JSON

Converting method between array List and JSON

You need some jar files.
1. json-lib-2.2.2-jdk15.jar
2. commons-beanutils.jar
3. commons-lang.jar
4. commons-collections.jar
5. commons-logging.jar
6. ezmorph-1.0.4.jar

Please set classpath those jar files.
And here is sample source to change from ArrayList to JSON.


import java.util.ArrayList;
import java.util.List;

import net.sf.json.JSONArray;

public class testA {

/**
* @param args
*/
public static void main(String[] args) {

List mybeanList = new ArrayList();
mybeanList.add("S");
mybeanList.add("b");

JSONArray jsonA = JSONArray.fromObject(mybeanList);
System.out.println(jsonA);
}

}

Friday 4 July 2008

error : hibernate with Data type in DB

* Error Message
"java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date"

You might have data type column in DB table and read it with hibernate.
In this case , you should update "dataSource.xml" file
Add " p:zeroDateTimeBehavior="convertToNull" "

=== Pull xml file =====
[?xml version="1.0" encoding="UTF-8"?]

[beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"]

[bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="com.mysql.jdbc.Driver"
p:url="jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=euckr&zeroDateTimeBehavior=convertToNull"
p:username="root" p:password="1111"]

[/beans]

Tuesday 1 July 2008

Aptana plugin

Plugging Aptana into an existing Eclipse configuration

http://update.aptana.com/install/studio/3.2/

Detail information
http://www.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration