Postingan

Menampilkan postingan dengan label J2EE

How to setup JNDI Database Connection pool in Tomcat - Spring Tutorial Example

Gambar
Setting the JNDI Database Connection pool in Spring and Tomcat is pretty easy. Tomcat server documentation gives enough information on how to setup connection pool in Tomcat 5, 6 or 7. Here we will use Tomcat 7 along with spring framework for creating a connection pool in Tomcat server and accessing them in Spring using JNDI code. In our last article, we have seen how to setup database connection pool in Spring for core Java application which doesn't run on a web server or application server and doesn't have managed J2EE container. but if you are developing a web application than its better to use s erver managed connection pool and access them using JNDI. Spring configuration will be generic and just based on JNDI name of Datasource so it will work on any J2EE Server e.g. Glassfish, WebLogic, JBoss or WebSphere until JNDI name is same. Btw, Tomcat is my favorite web server and I use it a lot on development as it comes integrated with IDE like Eclipse and Netbeans. I am using ...

Difference between save vs persist and saveOrUpdate in Hibernate

Gambar
Save vs. saveOrUpdate vs. persist in Hibernate What is the difference between save and saveOrUpdate or Difference between save and persist are common interview question in any Hibernate interview, much like the difference between get and load method in Hibernate. Hibernate Session class provides a couple of ways to save an object into the database by methods like save, saveOrUpdate, and persist.  You can use either save(),  saveOrUpdate() or persist() based upon your requirement for persisting objects into the database. The key thing is that all these objects are used to store data into the database but they also make a transient object persistent in Hibernate. Along with Spring framework Interview questions, Hibernate questions are also quite popular on Java interviews because of its status as leading ORM. It's good to prepare some questions from Hibernate before appearing in any J2EE interviews. One of them is the difference between save, saveOrUpdate and persist , w...

Top 5 Java EE or JEE Courses for Java Web Developers - Best of Lot

Gambar
The Java Platform Enterprise Edition 8 or Java EE 8 was released last year along with Java 9 in September 2017. If you are a Java developer or someone who wants to learn Java EE for web development and looking for some excellent courses to kickstart your learning, then you have come to the right place. In this article, I am going to share five excellent Java EE courses that cover both Java EE 7 and Java EE 8 and very useful for learning Java EE in 2018. If you are wondering what Java EE is and what does Java EE 8 brings into the table, let me give you a brief overview of Java EE first. The Java EE is actually a collection of Java technologies and APIs designed to support "Enterprise" Applications, which can generally be classified as large-scale, distributed, transactional, and highly-available applications intended to support mission-critical business requirements. It contains some of the most popular Java technologies you have heard of like Servlet, JSP, EJB, JAX-RS, JDBC,...

JSTL forTokens Tag Example - Split String in JSP

Gambar
JSTL forTokens tag is another tag in core JSTL library to support Iteration or looping. It effectively compliments, more useful <c:forEach> tag, by allowing you to iterate over comma-separated or any delimited String. You can use this tag to split string in JSP and can operate on them individually. forTokens tag has similar attributes like forEach JSTL tag except one more attribute called delims, which specifies delimiter. For example to iterate over colon-separated String "abc:cde:fgh:ijk", delims=":". By the way, forTokens tag also accept multiple delimiters, which means, you can split a big string into token-based upon multiple delimiter e.g. colon(:) and pipe (|), This will be more clear, when we will see examples of JSTL forTokens tag in JSP. Rest of attribute e.g. items, var, varStatus, begin, end and step are same, as they are in case of <c:forEach> tag. For quick review, items specify String which needs to be split-ed in token and var hold curren...