Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Posts Tagged ‘java’

Prototype scope in Spring beans

July 29th, 2010 Vinay 1 comment

When you specify a bean as prototype in xml file or through annotation

<bean
id=”myBeanInstance”
class=”com.xyx.PrototypeBeanExample”
scope=”prototype”
autowire=”byName”>

</bean>

it means that every time a request for this bean is made, a new instance is created. If you want to see the illustration

Prototype bean in Spring

Prototype is meant for beans which hold some state.

The  bean lifecycle also changes in prototype bean. From Spring’s doc

Spring does not manage the complete lifecycle of a prototype bean: the container instantiates, configures, decorates and otherwise assembles a prototype object, hands it to the client and then has no further knowledge of that prototype instance

Categories: Programming / tutorials Tags: ,

JDBC performance tuning with fetch size

July 25th, 2010 amit 2 comments

Problem: For a Oracle (backend) – Java (frontend) system, a query  returning about 500 K rows was running very slow and is taking about 45 mins.  Oracle database is hosted on server (A), has a separate application server (B), and client can access database from client machine (C), using SQLPLUS.  Query is running slow from the clients machine (C) and from the java front end (B).

Basic Checks on dbase:

Make sure to check following with respects to the tables / database in question:

  • Latest Database statistics exists for the tables in question.
  • Indexes
  • Degree of Parallelism at Table Level:
  • Optimizer mode

Database configuration parameters  – sga_max_size,  pga_aggregate_target , memory_target, processes Read more…

Integrating hibernate search with a Spring and JPA Application

July 19th, 2010 smitha 2 comments

In this post we will talk about how to integrate hibernate Search into your existing Spring, JPA and Hibernate application and some of the challenges we faced.

We  have a web application using Hibernate (with JPA ) and Spring. This application relies on Spring for transaction, bean initialization / injection etc. EntityManager, transaction are configured in application.xml file. When integrating Hibernate search in such an application one might face problems. In this post I am sharing some problems I faced during integration and the solutions for same.

Entitymanager configuration in my application.xml

Spring configuration:
<bean id=”propertyConfigurer”>
<property name=”location” value=”classpath:myproperties.properties”/>
</bean>

Read more…

Want to learn programming in Scala ?

July 13th, 2010 Vinay No comments

Java programmers, interested in learning about Scala ? If you have missed our earlier posts on scala

Twitter has been written in which programming language

Why did twitter dumped Ruby on Rails

For new England residents a chance to learn Scala with Venkat Subramaniam who will be presenting on Programming Scala on Aug 12 2010  at  NEJUG.

Venue : Sun Microsystems, Burlington , MA

Dr. Venkat Subramaniam, founder of Agile Developer, Inc., has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia. Venkat helps his clients effectively apply and succeed with agile practices on their software projects, and speaks frequently at international conferences and user groups. He is author of “.NET Gotchas,” coauthor of 2007 Jolt Productivity Award winning “Practices of an Agile Developer,” author of “Programming Groovy: Dynamic Productivity for the Java Developer” and “Programming Scala: Tackle Multi-Core Complexity on the Java Virtual Machine” (Pragmatic Bookshelf).

Categories: Tech news Tags: ,

How good are Spring certification practice tests at Skill-Guru ?

July 7th, 2010 Vinay No comments

In our previous posts we had mentioned that Ikoko has added 2 mock test of 50 questions each at Skill-Guru

Spring certification mock test 1

Spring certification mock test 2

These tests are priced at $0.99 each . So how good are the tests ?

Follow this discussion on javaranch to see what real users who have been through Spring certification are saying about the test

Failed Core Spring certification

Practice test for Spring Certification

June 24th, 2010 Vinay No comments

ikoko had added 2nd mock practice test for Spring Certification . He had added first test Core Spring 3.0 Certification Mock and has received very good response from users. The users have found value in the $0.99 test .

We hope that you like his Core Spring 3.0 Certification Mock Test 2 . This test covers topics on container, Test, AOP, SpEL, Database, JMS, JMX, Web, MVC, Remoting etc

Looking for your feedback and inputs.

Read Write into excel through Java by JExcel

June 23rd, 2010 fanand 7 comments

JExcelApi allows Java developers to read Excel spreadsheets and to generate Excel spreadsheets dynamically. In addition, it contains a mechanism which allows java applications to read in a spreadsheet, modify some cells and write out the new spreadsheet.

This API allows non Windows operating systems to run pure Java applications which can both process and deliver Excel spreadsheets. Because it is Java, this API may be invoked from within a servlet, thus giving access to Excel functionality over internet and intranet web applications.

Download JExcelApi JAR files from

http://jexcelapi.sourceforge.net/

Reading Spreadsheets

Here is the sample program which uses the javaexcel Read more…

Categories: Programming / tutorials Tags: ,

Use of environment variable in Java

June 20th, 2010 fanand No comments

In this post we will talk about environment variables in java , their role and how to use them in windows and Unix environment.

Reading environment Variables in Java

System environment variable can be used in the java application to set the system related values for ex: application path, database environment etc..,

In standalone application, start the JVM with the “-D” switch to pass properties to the application and read them with the System.getProperty() method.

SET myvar=Hello world

SET myothervar=nothing

java -Dmyvar=”%myvar%” -Dmyothervar=”%myothervar%” myClass

Then in myClass do the following

String myvar = System.getProperty(“myvar”);

String myothervar = System.getProperty(“myothervar”);

Read more…

Get Adobe Flash playerPlugin by wpburn.com wordpress themes