Quantcast
Channel: About Me
Viewing all 768 articles
Browse latest View live

Checked vs Unchecked exceptions in java

$
0
0
ExceptionHierarchyJava


In many of the projects we have worked on, we have seen different ways of coding and various different strategies, code formatting, class naming styles, databases and technologies and blaw blaw. The one thing that was same in all projects were “exceptions”. In nearly all the projects, they had custom...
Read more »


JDBC Basics : Types of JDBC Drivers?

$
0
0
JDBC-driver-type-4


Java database connectivity (JDBC) is the JavaSoft specification [PDF] of a standard application programming interface (API) that allows Java programs to access database management systems. The JDBC API consists of a set of interfaces and classes written in the Java programming language. Using these standard interfaces and classes, programmers can...
Read more »

JDBC MySQL Database Connection Example

$
0
0
JDBC-Icon


It’s very strange if you are still using JDBC in your project for database access because there are lot’s of powerful alternatives like hibernate and iBatis. But it is important to learn basics and it requires learning JDBC first. In this post, I am giving an example of making a...
Read more »

JDBC SELECT Query Example

$
0
0
JDBC-Icon


In previous posts, we have learned about types of JDBC drivers and the how to make database connection using JDBC. Let’s move forward and start interacting with database. First example I am picking up is SQL SELECT queries. SQL SELECT query are executed to fetch data stored in relational databases....
Read more »

JDBC SQL INSERT Query Example

$
0
0
JDBC-Icon


In previous posts, we have learned about types of JDBC drivers and the how to make database connection using JDBC and then how to execute SELECT Query. Let’s move forward. In this example I am picking up execution of SQL INSERT queries using JDBC. SQL INSERT query are executed to...
Read more »

JDBC SQL DELETE Query Example

$
0
0
JDBC-Icon


In previous posts, we have learned about types of JDBC drivers and the how to make database connection using JDBC and then how to execute SELECT Query, and then INSET Query example. Let’s move forward. In this example I am picking up execution of SQL DELETE queries using JDBC. SQL...
Read more »

How to execute PreparedStatement using JDBC

$
0
0
JDBC-Icon


In database management systems, a prepared statement or parameterized statement is a feature used to execute the same or similar database statements repeatedly with high efficiency. Typically used with SQL statements such as queries or updates, the prepared statement takes the form of a template into which certain constant values...
Read more »

Best practices to improve JDBC performance

$
0
0
JDBC-Icon


Java database connectivity (JDBC) is the JavaSoft specification of a standard application programming interface (API) that allows Java programs to access database management systems. The JDBC API consists of a set of interfaces and classes written in the Java programming language. Using these standard interfaces and classes, programmers can write...
Read more »


MySQL Configuration Tutorial

$
0
0
MySQL


MySQL is the world’s most popular open source database, sporting a barrier of entry low enough to attract novice developers yet powerful enough to power some of the world’s most popular websites, among them Yahoo!, BBC News, the U.S. Census Bureau, and Craigslist. It is the world’s second most widely...
Read more »

How to Install/Uninstall/Execute MySQL as Windows Service

$
0
0
Install as a MySQL Windows service manually


On Windows, It is always recommended to install and run MySQL as a Windows service, so that MySQL starts and stops automatically when Windows starts and shutdown. Also, it can be managed using the services section of control panel. A MySQL installed as a service can also be controlled from...
Read more »

Managing Users from Console in MySQL Database

$
0
0
MySQL


MySQL is packaged with a powerful security model, capable of controlling practically every conceivable user action, ranging from which commands he can execute to how many queries he can execute in an hour. This works in a two-steps: 1) Authentication :- The user’s host, username, and password are examined. If...
Read more »

Spring 3.2.5.RELEASE and Hibernate 4 Integration Example Tutorial

$
0
0
Dynamic web project creation in eclipse


If you have gone though my previous post, which was also on same topic i.e. Spring 3 + Hibernate integration. I received lots of comments and feedback in that post, and most of them was because people were trying to use code/dependency either in their existing projects OR they were...
Read more »

[SOLVED] java.lang.NoClassDefFoundError: org/hibernate/engine/SessionFactoryImplementor

$
0
0
Random exceptions


If you are trying to setup your project/ or adding dependency for hibernate 4 then you might face this error in your server logs. Stack-trace will be looking like this: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined...
Read more »

[SOLVED] java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider

$
0
0
Random exceptions


If you are trying to setup your project/ or adding dependency for hibernate 4 then you might face this error in your server logs. Stack-trace will be looking like this: Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.howtodoinjava.dao.EmployeeDaoImpl.sessionFactory; nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider; at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at...
Read more »

[SOLVED] Bean property ‘configurationClass’ is not writable or has an invalid setter method

$
0
0
Random exceptions


If you are trying to setup your project/ or adding dependency for hibernate 4 then you might face this error in your server logs. Stack-trace will be looking like this: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not...
Read more »


jQuery: difference between keypress and keydown events

$
0
0
jQuery supports 3 types of keyboard events and which we are : keyup(): Event fired when a key is released on the keyboard. keydown(): Event fired when a key is pressed on the keyboard. keypress:() Event fired when a key is pressed on the keyboard. From above definitions, it looks like that keydown() and keypress() […]

Difference between standard IO and NIO

$
0
0
The new input/output (NIO) library was introduced with JDK 1.4. Picking up where original I/O leaves off, NIO provides high-speed, block-oriented I/O in standard Java code. By defining classes to hold data, and by processing that data in blocks, NIO takes advantage of low-level optimizations in a way that the original I/O package could not, […]

jQuery: Detect if ENTER key is pressed

$
0
0
This is common sense that if you have to detect a key pressed in browser then you must check in keycode (ascii) value. Simple and easy. The problem arises when you don’t know how to correctly use this functionality. e.g. whether you need to bind keypress or keydown? What is ascii value of ENTER key? […]

Spring 3.2.5 AbstractRoutingDataSource example

$
0
0
AbstractRoutingDataSource is very useful feature in spring framework if you do have a design which permits multiple databases based on certain criteria which may change for each user request. An example can be use of database. You can use a particular database when user belongs to certain locale and switch to another locale if user […]

Do not specify version numbers in Spring schema references

$
0
0
If you have worked on Spring projects, then you must have seen spring configuration files where in header you specify the schema references for various spring modules. In schema references, we mention the xml namespace and as well as it’s version number. Well specifying version number is not mandatory at all, and you can omit […]
Viewing all 768 articles
Browse latest View live