View RSS Feed

Recent Blogs Posts

  1. Working with JDBC in Java

    by , 04-04-2012 at 07:32 AM
    Java Database Connectivity (JDBC) is a technology that allows Java applications working with relational database management systems (RDBMS) such as MySQL, Microsoft SQL Server, Oracle, PostgreSQL, via Structured Query Language (SQL) statement. The JDBC API is included in JDK, so any Java application can communicate with various database systems without requiring additional installation, as long as a JDBC driver is provided for the targeted database system.

    By the end of this article, ...
  2. Retrieving auto generated key (JDBC 3.0)

    by , 11-28-2011 at 07:41 PM (My Java Tips)
    JDBC 3.0 introduces a lot of interesting and exciting features which makes database programming simpler. In this post, I will address how to retrieve auto generated keys using JDBC 3.0.


    To get the key, simply specify in the statement's execute() method an optional flag denoting that you are interested in the generated value. Flags of your interest are: Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS. Execute the statement and now you can obtain the values of the generated ...
    Categories
    JDBC
  3. Wrapping JDBC Objects

    by , 05-25-2011 at 10:55 AM (My Java Tips)
    In Glassfish connection pool has a property called "Wrap JDBC Objects" which can have value true or false. You may define it in domain.xml file.

    This property is defined as: "When set to true, application will get wrapped jdbc objects for Statement, PreparedStatement, CallableStatement, ResultSet, DatabaseMetaData".

    If you follow JDBC specifications, you will be see that obtaining connection using DataSource.getConnection() or other objects like ...