বৃহস্পতিবার, ২৯ ডিসেম্বর, ২০১১

how can I use external jars in an android project

  1. Create a folder call 'lib' into you project root folder
  2. Copy your Jar files to the lib folder
  3. Now right click on the Jar file and Build Path > Add to Build Path, this will create a folder called 'Refrenced Library' into you project, and your are done

বুধবার, ১৪ ডিসেম্বর, ২০১১

Declarative Transaction Management

Declarative transaction management means that you don’t write transaction management code in
your beans at all; instead, you configure the beans to be transactional. We can therefore take the
DefaultBankService from Listing 16-8 and specify in the bean configuration that we want the
transfer method to be transactional. The simplest way to achieve this is to use a proxy: the proxy will
intercept all method calls, and if the method name is included in the transactional configuration, the
proxy will act as around advice. It will begin the transaction before the call to the target method and
execute the target method in a try / catch block. If the target method finishes normally, the proxy
commits the transaction; if the target method throws a runtime exception, the proxy performs a roll-
back. To do all this work, the proxy will use the configured PlatformTransactionManager. This is the
core concept of declarative transaction management; the differences are in the way we can create
the proxy. Let’s begin with the legacy way, using the TransactionProxyFactoryBean.

মঙ্গলবার, ১৩ ডিসেম্বর, ২০১১

Mobile Development

1. http://techprithibi.com/eprithibi/1059
2. Video tutorial
3. http://www.learn-android.com/2010/01/05/android-layout-tutorial/5/
4. how can I use external jars in an android project
5. json/xml
6. 10 important project tutorial
7. http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data
8. http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/
9. http://malsandroid.blogspot.com/2010/06/accessing-call-logs.html

opensessioninviewinterceptor vs opensessioninviewfilter

http://www.jroller.com/kbaum/date/20050406

http://chenyuye.blogspot.com/2008/05/spring-opensessioninviewinterceptor-vs.html


http://tadaya.wordpress.com/2008/07/31/opensessioninview-filter-vs-interceptor/

বৃহস্পতিবার, ৮ ডিসেম্বর, ২০১১

Spring 3 Property file read

Often times, most Spring developers just put the entire deployment details (database details, log file path) in XML bean configuration file as following :

<beans xmlns="http://www.springframework.org/schema/beans"
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.xsd ">


<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/oushod"/>
<property name="user" value="userName"/>
<property name="password" value="password"/>

<property name="minPoolSize" value="5"/>
<property name="maxPoolSize" value="20"/>
<property name="checkoutTimeout" value="300"/>
<property name="maxStatements" value="100"/>
</bean>


But, in a corporate environment, deployment detail is usually only can ‘touch’ by your system or database administrator, they just refuse to access your bean configuration file directly, and they will request a separate file for deployment configuration, for example, a simple properties, with deployment detail only.

To fix it, you can use PropertyPlaceholderConfigurer class to externalize the deployment details into a properties file, and access from bean configuration file via a special format – ${variable}.
Create a properties file (db.properties), include your database details, put it into your project class path.

driverClass=com.mysql.jdbc.Driver
jdbcUrl=jdbc:mysql://localhost:3306/oushod
user=root
password=admin


Declare a PropertyPlaceholderConfigurer in bean configuration file and map to the ‘db.properties‘ properties file you created just now.


<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db.properties</value>
</list>
</property>
</bean>



Full example

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
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.xsd ">

<import resource="applicationException.xml"/>

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db.properties</value>
</list>
</property>
</bean>

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${driverClass}"/>
<property name="jdbcUrl" value="${jdbcUrl}"/>
<property name="user" value="${user}"/>
<property name="password" value="${password}"/>

<property name="minPoolSize" value="5"/>
<property name="maxPoolSize" value="20"/>
<property name="checkoutTimeout" value="300"/>
<property name="maxStatements" value="100"/>
</bean>

</beans>