Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....


CDI & EJB: Sending asynchronous mail on transaction success


Hello again! :) This time I’ve chosen a common task that most of the time, in my opinion, is done the wrong way: sending e-mails. Not that people can’t figure out how e-mail APIs work, such as JavaMail or Apache’s commons-email. What I usually see as a problem is that they underestimate the need to make the sending mail routine ...

Read More »

Apache Wicket with Lambda Expressions


What’s up? :) I’ve been working on some projects that thankfully use Apache Wicket for the presentation layer. It naturally occurred to me how Java’s 8 lambda expressions fit perfectly with Wicket. And not just me, the Wicket team seems to be already working on changing the API to provide support for lambdas out of the box. This article will ...

Read More »

JDBC入门教程 – 终极指南


本教程主要介绍JDBC(Java数据库连接)—— 一个Oracle提供的API,它可以帮助程序员处理Java应用程序中不同数据库的访问问题:程序员可以通过它建立与数据库的连接;定义特定的客户端使之可以访问给定的数据库;提供一种能够读取、插入、更新和删除数据库中的数据项的机制;以及控制由不同SQL语句组成的事务。 在本文中我们会介绍主要的JDBC组件,包括声明(Statement)、结果集(Result Set)、存储过程(Stored Procedure)。 程序员们需要针对不同的数据库提供相应的驱动程序;在后面的章节我们会结合一些实例来详细解释。 JDBC是伴随Java的产生而产生的;它的第一个版本产生于1997年2月,也就是JDK1.1的发布日期;自那以后,JDBC已经成为Java的一个重要组成部分。JDBC相关的主要包有: 和 关于JDBC的最新版本和开发、维护信息可以访问JSR 221获得。 本文中的所有例子的实现环境是Java 8 update 0_25和Eclipse SDK  Luna 4.4. 你可以在本文的最后下载所有这些例子,而且还可以下载其他更多的例子! 目录 1. 组件(Components) 2. 数据库连接(Connections) 3. 数据类型(Data types) 4. 驱动程序(Drivers) 5. 数据库(Databases) 6. 结果集(Result Sets) 7. 存储过程(Stored Procedures) 8. 声明(Statements) 9. 批处理命令(Batch Commands) 10. 事务(Transactions) 11. CRUD 命令 12. Java 8 13. 基于JDBC的SQL类库 14. 单元测试 15. 总结 16. 源码下载 17. 相关链接 1. 组件(Components) JDBC API使得程序员和Java应用程序可以与数据库进行交互。它能够在各种数据源环境下:执行不同的SQL语句、处理返回的结果集。 在这一节中,我们会综述并列出一些最重要的JDBC组件,他们都是Java应用程序的一部分;我们会在接下来的章节详细介绍它们。 首先,Java应用需要创建并建立与特定数据库的连接。这可以通过Driven Manager完成,比如,接口java.sql.DriveManager的实例;或者直接通过JDBC数据源进行连接。接口javax.sq.DataSource可以用来建立JDBC数据源连接。后面的章节会详细介绍这些组件。 一旦连接到数据库,我们就可以使用java.sql.Connection来执行CRUD (创建-create, 读取-read, 更新-update, 删除delete) SQL 语句或操作。后面的章节会详细介绍这些语句。 为了执行这些操作,程序员可以使用基于java.sql.Statement and java.sql.PreparedStatement 的类。需要多次执行相同的语句,后者会更高效一些,另外它也提供了一些我们将会在本教程后面章节提到的优点。接口JDBC连接提供了很多机制来创建statement实例: PreparedStatement countriesStatement = connection.prepareStatement("UPDATE COUNTRIES SET ...

Read More »

Authentication Mechanisms for Web Applications


Authentication is the basic requirement for most of websites. However, there are many mechanisms to implement authentication and they are not very interchangeable. Depend on business requirement, developers need to choose the most appropriate method of authentication for their application. It may not be an easy task unless one understand the differences among mechanisms well. In this short article, I ...

Read More »

9 Docker recipes for Java EE Application


Cross-posted from So, you’d like to start using Docker for Java EE applications? A typical Java EE application consists of an application server, such as WildFly, and a database, such as MySQL. In addition, you might have a separate front-end tier, say Apache, for load balancing a number of application server. A caching layer, such as Infinispan, may be used ...

Read More »

69 个Spring 面试问题和答案 – 终极列表 (PDF 下载)


这篇文章是关于Spring框架的一些最重要问题的总结,在面试或笔试过程中可能被问到! 不用担心您的下一个面试的的测试,因为Java Code Geeks会为您服务!您可能被问到的大部分问题都列在了这里。所有的核心模块, 从基础的Spring功能例如Spring Beans到 Spring MVC 框架都被列在了这里而且简单的介绍了。在查看了这些面试问题后,您可以查看我们的 Spring教程页面。那么,我们开始吧…!   提示:您在寻找java方面的工作机会吗?访问我们的工作面板  来搜索和查看精心选择的为全世界的IT专业人士准备的Java工作。另外,您也可以把您的简历添加到我们的  简历面板来提高您的技能来使全世界的Java招聘者看到您。 目录 Spring 概述 依赖注入 Spring Beans Spring 注解 Spring 数据访问 Spring 面向方面编程 (AOP) Spring 模型视图控制器 (MVC) Spring 概述 1. Spring是什么? Spring是针对企业版 Java的开源的开发框架 。Spring框架的核心功能能被用于开发任何的Java程序,但有针对基于Java EE平台上的Web应用程序的扩展。Spring框架的目标是使JavaEE的开发更加容易并通过使用基于POJO的编程模型来促进编程最佳实践的应用。 2. Spring 框架有什么优势? 轻量级: 在尺寸和透明度方面Spring 是轻量级的。spring框架的基础版本只有大约 2MB 大小。 控制反转 (IOC): 通过控制反转技术 ,Spring实现了松耦合。对象间只是给出了依赖性,而不是创建或寻找依赖对象。 面向切面 (AOP): Spring 支持面向切面编程 而且把应用的业务逻辑从系统服务分离开了。 容器: Spring 包含并管理应用对象的生命周期和配置。 MVC 框架: Spring的 web 框架是一个设计良好的 web MVC 框架, 它可以作为其他web框架的替代。 事务管理: ...

Read More »

Improving performance: non-blocking processing of streams


1. Introduction Imagine we have an application that needs to access an external web service in order to gather information about clients and then process it. More specifically, we can’t get all this information in a single invocation. If we want to look up different clients, we will need several invocations. As shown in the graphic below, the example application ...

Read More »

Microservices, DevOps, and the cost of change?


As developers, we all love shiny new things. New technologies (Docker, Kubernetes), new languages (Golang, NodeJS), new hyped conversation starters (Microservices, DevOps, Cloud). And everyone seems to have an opinion about why you should do this architecture, or why you should use that language. At the end of the day, your employer is expecting you to deliver using a means ...

Read More »

Turning on GC logging at runtime


There is always the next JVM behaving badly. And you know by heart that if you just could have had those few startup options exposing some more information about what is going on, you might have stood a chance of actually fixing the goddamn thing. But nope, exactly the flag you need (be it -XX:+HeapDumpOnOutOfMemoryError or -XX:+PrintGCDetails) is always missing. ...

Read More »

Getting Java Event Notification Right


Implementing the observer pattern to provide Java event notification seems to be a straight forward thing to do. However there are some pitfalls one easily can run into. Here comes an explanation of common mistakes I carelessly have produced myself on various occasions… Java Event Notification Let’s start with a simple bean StateHolder that encapsulates a private int field state ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.