JDBC « Database JDBC « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Database JDBC » JDBC 

1. JDBC drivers in the wild    javaworld.com

The I-net Sprinta 2000, which can be dynamically downloaded, does not require you to install special software on the client or server. Hence, it's a good solution for Internet applications.

2. Create your own type 3 JDBC driver, Part 2    javaworld.com

In Part 1 of this three-part series, we showed how to construct a type 3 JDBC driver, named JWDriver, that employed RMI (Remote Method Invocation) to let the client talk to the middle tier. Continuing with JWDriver's development, in this article we explain how to compile the driver, then deploy it in a Web server environment. Further, we explain the Java files' directory structure for both the client and server tiers, then we run the driver's server tier, giving any client program access. We also include a sample Java applet (deployed on the Web server) to demonstrate how the driver can access data.

3. Create your own type 3 JDBC driver, Part 1    javaworld.com

In this three-part series, we first introduce our own type 3 JDBC driver's architecture and design (Part 1), then show how to implement and deploy the driver (Part 2), and finish by explaining how you can add advanced features to the driver, like SQL logging or connection pooling (Part 3).

4. Integrating Databases with Java via JDBC    javaworld.com

The first standardized work on Java-DBMS connectivity appears in a draft specification known as the Java Database Connectivity (JDBC) Application Programming Interface (API) specification. Created with the help of the aforementioned database and database-tool vendors, it is intended to fill the current vacancy in this level of connectivity that has prompted companies like Weblogic to develop proprietary interfaces.

5. Overpower the PreparedStatement    javaworld.com

How an application interacts with the database represents an often-overlooked aspect of application development. Indeed, many programmers find the simplest way to get the data, then leave the database-tuning to the database administrator. However, application-side Java techniques can boost your database's performance, thus improving your application's efficiency. As mentioned above, Java's PreparedStatement interface frequently offers the best way to accomplish that task.

6. Named Parameters for PreparedStatement    javaworld.com

This brings us to my class which is called (for lack of a better name) NamedParameterStatement. The syntax is the same as PreparedStatement except that, instead of question marks, parameters are represented as a colon followed by an identifier.

7. Eliminate JDBC overhead    javaworld.com

The article "Clever Facade Makes JDBC Look Easy" by Thomas Davis (JavaWorld, May 1999), addressed some, but not all, my needs. Specifically, the JDBC Facade he described fails to handle transactions, factor out the building of prepared statements, and cleanly handle the result set. Therefore, I took it upon myself to develop a simple architecture that included those functionalities and eliminated all that displeased me. This article outlines that architecture.

8. Create your own type 3 JDBC driver, Part 3    javaworld.com

Architecturally, type 3 JDBC (Java Database Connectivity) drivers prove flexible enough that you can easily add enhancements. In Parts 1 and 2 of this three-part series, you learned how to create a custom type 3 JDBC driver, named JWDriver, that employed RMI (Remote Method Invocation) to communicate with the middle tier. In this article, the last of the series, we demonstrate how to enhance JWDriver's functionality with three new features:

9. Clever Facade makes JDBC look easy    javaworld.com

Design patterns seem to be the underlying theme this month. I discussed a few above when I addressed comments from readers regarding last month's tool. And we're going to talk about yet another one in this part of my article, which is devoted to the new tool. Called Facade, this design pattern is a high-level interface that encapsulates many other subsystem interfaces. This month I'm applying Facade to the more popular JDBC classes. What does this do for us? It means you get the same JDBC functionality -- high-level database abstraction -- with a lot less typing. Your database-related code will thus be smaller and cleaner.

10. Getting Up To Date with JDBC API    onjava.com

The JDBC API is Java's way of accessing any tabular data source, typically a relational database. The API presents an object-oriented interface to the data and is made up of classes and interfaces in the java.sql package, with standard extensions in javax.sql. Since JDBC 1.0, a lot of functionality has been added to the API. JDBC 2.0 introduced scrollable result sets, updatable result sets, batch update capability and support for new SQL3 data types. The new JDBC 3.0 specification, in its proposed final draft form at this point, is promising to add more robust transactions by way of savepoints, a number of resource pooling enhancements, retrieval of auto-generated keys and a lot more. Through all of the additional functionality, the API has remained very straightforward and very easy to work with. This article discusses a number of these new areas of functionality.

11. Tuning JDBC: Measuring JDBC performance    onjava.com

Java Database Connectivity (JDBC) is used extensively by many Java applications. In this article, the first of a series on performance-tuning JDBC, I look at how to measure the performance of JDBC and how to identify which parts of your JDBC subsystem need optimizing.

12. Using Global/Distributed Transactions in Java/JDBC with Oracle Real Application Clusters    onjava.com

An Oracle Real Application Cluster database is a clustered database. A cluster is a group of independent servers that cooperate as a single system. Clusters provide improved fault resilience and modular incremental system growth over single, symmetrical multiprocessor systems. Oracle's RAC page has more information on RAC technology.

13. Using CachedRowSet to Transfer JDBC Query Results Between Classes    onjava.com

In this article, you've learned how to harness the power of the CachedRowSet by creating a common SQL interface to pass query data between classes, and propagate changes back to the database. In many ways more robust and elegant than a traditional "connected" ResultSet, the CachedRowSet provides increased functionality, to boot. In fact, we've barely scratched the surface. If you're interested in doing some further reading, be sure to check out the RowSet chapter in the Sun Developer Network JDBC tutorial. They cover two additional implementations of RowSet (JDBCRowSet and WebRowSet) that could prove useful in your next JDBC application, as well.

14. JDBC 4.0 Enhancements in Java SE 6    onjava.com

Java Platform, Standard Edition (Java SE) version 6 (code name Mustang), is currently in its second beta release and is scheduled to be delivered in October of this year. Java SE 6 includes several enhancements to the Java Database Connectivity (JDBC) API. These enhancements will be released as JDBC version 4.0. The main objectives of the new JDBC features are to provide a simpler design and better developer experience. This article provides an overview of the JDBC 4.0 enhancements and what benefits they offer to enterprise Java developers. We will explore the new JDBC features with the help of a sample loan processing application using Apache Derby as the back-end database.

15. Java Programming with Oracle JDBC: Performance    onjava.com

When it comes to performance issues concerning JDBC programming there are two major factors to consider. The first is the performance of the database structure and the SQL statements used against it. The second is the relative efficiency of the different ways you can use the JDBC interfaces to manipulate a database.

16. Top Ten Oracle JDBC Tips    onjava.com

The Java Database Connectivity (JDBC) API is a set of interfaces that allow a Java programmer to access a database. The interfaces are implemented by each vendor's set of implementation classes. After several years of working with Oracle's JDBC implementation, I've learned a number of things that you can do to squeeze out the best performance and the most functionality.

17. Making the Most of JDBC with WebRowSet    onjava.com

At the time of this writing, JDK version 5.0 is the most recent release version of Java that supports JDBC version 3.0. This version of JDBC provides several features for ease of use and flexibility of data manipulation and transformation. In this article, I will first briefly explain its inheritance hierarchy, followed by an example that shows how we can use some of the features of the javax.sql.rowset.WebRowSet interface to easily transform data from database to XML files and vice versa. Then I will discuss some of the benefits and liabilities of this interface. I will conclude after explaining some of the scenarios in which this interface is better choice.

18. An Introduction to JDBC, Part 2    onjava.com

The JDBC 2.0 standard extension, discussed later in this chapter, provides a facility for connection pooling, whereby an application can maintain several open database connections and spread the load among them. This is often necessary for enterprise-level applications, such as servlets, that may be called upon to perform tens of thousands of database transactions a day.

19. An Introduction to JDBC, Part 1    onjava.com

A word of caution: while the java.sql package is not tremendously complex, it does require grounding in general database concepts and the SQL language itself. This book includes a brief SQL reference (see Chapter 12), but if you have never worked with a relational database system before, this chapter is not the place to start. For a more complete treatment of JDBC and general database concepts, we recommend Database Programming with JDBC and Java by George Reese (O'Reilly).

20. Performance Tips for the Data Tier (JDBC) - Selecting Functions that Optimize Performance    theserverside.com

In the last performance tip, we discussed some tips of how to retrieve only the data that you require. These general rules about selecting functions that optimize performance should help you solve some common JDBC system performance problems.

21. Performance Tips for the Data Tier (JDBC) - Retrieving Only Required Data    theserverside.com

In the last performance tip, we discussed using database metadata appropriately. These general rules about retrieving data should help you solve some common JDBC system performance problems.

22. Performance Tips for the Data Tier (JDBC) - Managing Connections and Updates    theserverside.com

In the last article, we discussed selecting functions that optimize performance. These general rules about managing connections and updates should help you solve some additional common JDBC system performance problems.

23. Migrating JDBC Data Access Objects to use EJB3    theserverside.com

Persistence is one of the greatest challenges for building applications. There are many options for building persistence layers. Data Access Objects (DAO) is a popular design pattern for building the persistence layer of a J2EE application. Developers use this design pattern primarily to separate their JDBC code from business logic. The EJB3 Java Persistence API, which defines the persistence API for the Java platform based on O-R solutions such as Oracle TopLink and JBoss Hibernate, lets developers skip the mundane task of building DAO and JDBC code. Most developers will be using the EJB3 Java Persistence API instead of writing JDBC code with DAO.

24. Querying GigaSpaces with a JDBC adapter    theserverside.com

Using the GigaSpaces XAP product along with OpenSpaces and Spring allows the user the choice to receive both continuous queries through the configuration of a notify-container as well as snapshots of state returned according to either a specific or range query posed.

25. What's New in JDBC 4.0?    today.java.net

Among many new features and enhancements in Java SE 6 is the Java Database Connectivity (JDBC) API library, which is updated to JDBC 4.0 in this version of Java SE. JDBC 4.0, specified as JSR-221 under the Java Community Process, provides better code manageability and flexibility, and more complex data type support. In this article I will explore some new features and enhancements available in JDBC 4.0 from the perspective of programming ease and flexibility.

26. The JDBC RowSet Implementations Tutorial    today.java.net

In "The JDBC RowSet Implementations Tutorial," you will look at how to use the standard JDBC RowSet implementations specified in JSR-114. JDBC RowSets are provided as part of Java 5.0, supplying both a standard set of level APIs and a production-ready reference implementation that will work with any JDBC-3.0-compliant driver. You can quickly get up to speed with each RowSet definition, while benefiting from improved scalability and robustness for JDBC-enabled applications. By the JDBC Team.

27. DBAccessor: A JDBC Wrapper Package    java.sun.com

Given all the features of the JDBC API, why should any developer need the added functionality of the DBAccessor wrapper? After all, the JDBC API provided as part of the Java 2 Standard Edition (J2SE) gives you an extremely useful and popular way to access database systems from within Java programs. The API offers methods to open and close database connections, issue query and update statements, and also retrieve information -- such as table and column structure -- in a database-independent way.

28. Duke's Bakery - A JDBC Order Entry Prototype - Part I    java.sun.com

In the article " JDK 1.2 Roadmap: Putting It All Together" we met Kate Cookie, owner and operator of "Duke's Bakery". Kate had hired programmer Madhavi Rao to design a software architecture for Duke's Bakery. After completing that job, Madhavi was recruited as part of a large scale Java development project for a web-based retailer. When Kate called, requesting a prototype system, Madhavi referred the job to me.

29. Get disconnected with CachedRowSet    java.sun.com

You could consider the CachedRowSet as a "disconnected" ResultSet. It is an early implementation of the javax.sql.RowSet, and because javax.sql.RowSet extends the java.sql.ResultSet interface, you are probably already familiar with many of its methods. The RowSet interface supports the JDBC API from the JavaBeans component model perspective. It provides all the methods and features of a standard JDBC 2.0 ResultSet, but doesn't require the continuous use of a database connection. Just like any other JavaBean, implementations of javax.sql.RowSet may be serialized. This allows for ResultSets to be serialized, sent to remote clients, updated, and then sent back to the server.

30. Ever Feel Like Life Is Just Scrolling By?    java.sun.com

Aaron Alpar uses this code as an example of how to use the JDBC to implement a workaround for a scrolling cursor. It illustrates a number of important techniques, such as how to handle connections, rows, and columns. Enjoy!

31. TSS Featured Entry: Using Hibernate3 as a JDBC Framework    theserverside.com

There's been a certain amount of noise recently surrounding simple JDBC frameworks like iBATIS. I've liked the idea of iBATIS myself, for use in applications which don't need an object-oriented domain model, and don't work with deep graphs of associated entities in a single transaction. A JDBC framework also makes good sense if you are working with some kind of "insane" legacy database; ORM solutions tend to assume that associations are represented as nice clean foreign keys with proper referential integrity constraints (Hibernate3 much less so than Hibernate 2.x).

32. Upcoming Features in JDBC 4    artima.com

Version 4 of the JDCB API is currently in Early Draft Review in the JCP (JSR 221)[1]. While prior JDBC versions focused on incremental improvements providing functionality to J2EE application servers, JDBC 4's key priority is to make it easier for developers to work directly with the JDBC API. Thus, the latest JDBC spec is a return to the API's roots, which was to provide a set of simple abstractions for developers who needed to work with relational databases. Much of JDBC 4's ease-of-development features are a direct result of new capabilities available in J2SE 1.5.

33. JDBC-ODBC Bridge Driver Enables Spreadsheet-as-database Interaction    devx.com

Programming interfaces such as Apache Jakarta POI allow a Java application to programmatically modify Excel spreadsheets (see "Learn to Read and Write Microsoft Excel Documents with Jakarta's POI"). Unfortunately, such APIs allow only cell-by-cell interaction with spreadsheets. They do not enable interacting with a spreadsheet as if it were a database, which utilizes the power of SQL. By tapping into the JDBC-ODBC bridge driver, you can work with spreadsheets as databases.

34. Microsoft's JDBC Driver for SQL Server Stacks Up Against Competition    devx.com

The project started in 1997, when JDK 1.1 had just been released. Very few JDBC drivers were available for SQL Server then, and particularly unfortunate was the lack of Type 4 drivers. To understand why the Type 4 driver is preferable to the others available, examine the different types of driver Sun Microsystems lists:

35. Developing JDBC Applications with DB2's pureXML    devx.com

Today, pure Java drivers (type 4) are the most popular for Java application development because of their adaptability and natural fit with many application servers and open source tools. As such, IBM promotes the JDBC Universal type 4 driver (popularly termed the JCC driver) as the primary driver for DB2 V9 (see Sidebar 2. JCC Driver for DB2). At the same time, the introduction of native XML data storage in DB2 V9 goes a long way in simplifying XML utilization in Java applications.

36. Simple Solution for Complex Java Web Applications: Connection Pools and JDBC    devx.com

A connection pool helps you manage and control the database connections from JSP/servlets, where you can store information between client requests. This article discusses the advantages of using a connection pool in your Java distributed systems programming. It requires a working knowledge of Java Web programming, databases, and JDBC, as well as an environment where you can access these technologies.

37. Quick-and-dirty Java programming: Setting up a data source for JDBC    ibm.com

The sample programs in this article are set up so you can use them with the widely available mySQL OpenSource RDBMS server. By simply changing the driver and connection URL, you can get the sample to work with your own RDBMS. I have provided an MS Access-compatible MDB file for those who would like to use the JDBC-ODBC bridge provided as part of the Win32 distribution of the JDK. You will find the database file in the source distribution as fesitest.mdb. To modify the samples for using with this database, follow these steps:

38. Managing database connections with JDBC    ibm.com

This tutorial introduces the different concepts involved in establishing and managing a database connection from within a Java? application using Java Database Connection (JDBC). It is targeted primarily at developers who want to understand what is going on "under the hood" when using a database from within a Java application.

39. Advanced database operations with JDBC    ibm.com

This tutorial introduces several advanced database operations, including stored procedures and advanced datatypes, that can be performed by a Java? application using JDBC.

40. Optimize your existing JDBC applications using pureQuery    ibm.com

In Version 1.2, Data Studio Developer and Data Studio pureQuery Runtime include a new feature called client optimization that enables DBAs and developers to take advantage of the benefits of static SQL execution without having to modify their existing custom-developed, framework-based, or packaged JDBC applications. This tutorial shows you how to use the tooling provided by Data Studio Developer to enable a JDBC application to use this new capability.

41. An easy JDBC wrapper    ibm.com

In this article, we've taken a look at an API that provides a simplified interface to relational databases via the JDBC package. This abstraction retains many of the basic relational features of the JDBC interface, but simplifies them in such a way that makes it very easy to use. This simplification comes at the cost of efficiency, but that is not a surprising result when the goal is simplicity.

42. JDBC query logging made easy    ibm.com

In most cases, JDBC PreparedStatements make performing database queries much easier, and can yield significant improvements in your overall application performance. But the PreparedStatement interface falls short when it comes to logging query statements. Whereas a PreparedStatement's strength lies in its variability, a good logging entry must describe exactly how the SQL being sent to the database will look after all the parameter placeholders have been replaced with actual parameter values. While there are several ways to get around this conundrum, none of them is easy to implement on any large scale, and most will clutter up your code.

43. What's new in JDBC 3.0    ibm.com

The Java Database Connectivity (JDBC) 3.0 specification builds on an already solid foundation by adding several new features that address a number of areas of missing functionality. Both the java.sql and, for the first time, the javax.sql packages will be included in the Java 1.4 platform, currently in beta. Java developers will be able to take advantage of the enhancements when it is released later this year, which makes this a good time to start understanding the changes.

44. Using JDBC to create database objects    ibm.com

In this article, we've discussed databases and ways of examining them and executing queries on them. We've seen that the JDBC provides a platform and a database-independent, object-oriented way to access these data, and we've looked at the major objects of JDBC: the ResultSet, ResultSetMetaData, and DatabaseMetaData. After writing a simple program using these objects, we designed higher-level resultSet and Database objects which we used to build a simple visual interface to display database information.

45. Building Web-based applications with JDBC    ibm.com

If you're looking to build a Web application that interacts with a backend database using JDBC but you're not sure how, then this tutorial is for you. In this hands-on guide, you'll learn the fundamentals of this process using three separate techniques: a servlet approach, a JavaServer Pages (JSP) page approach, and combined JSP, JavaBeans, and servlet approach (also known as Model Two). Follow along with expert Robert Brunner as he steps you through each process and discusses the pros and cons of each.

46. JCP Watch: JDBC in the Palm of Your Hand    developer.com

Two JDBC related JSRs went final over the past few week. The first deals with an optional package for the J2ME mobile Java platform while the other introduces a long awaited Rowset specification for programmatic iteration over tabular data. Further, public review specifications for Java 1.5 (J2SE, Tiger) and an approval to start work on defining J2EE 1.5 were also released.

47. Connecting to a Database with JDBC    developer.com

In this article, you covered the basic concepts involved with connecting to a database from a Java application using JDBC. Incorporating a database into an application greatly expands your development options. Although this is a series of articles on object technologies, you may have noticed that you used a relational database, Microsoft Access. You will explore this issue in more detail next month. Also, as already noted, JDBC can be used in conjunction with any number of databases as long as you have the appropriate driver installed on your system.

48. Using More Advanced JDBC Features    developer.com

In the previous article, I covered the basics of connecting to a database using Java Database Connectivity (JDBC). In these examples, you will connect to a Microsoft Access database; however, you are not limited to a specific technology when using JDBC. In future articles, you will explore other databases.

49. SQLExecutor: A Simple JDBC Framework    developer.com

When I designed the SQLExecutor framework, my primary focus was on creating a very simple interface to the JDBC API. I wanted to minimize the number of classes and methods the framework user needed to learn as well as reduce the number of lines of code required to execute SQL statements. I did not try to complicate the framework by supporting every arcane use of JDBC—there may be instances when you will need to write low-level JDBC code in order to accomplish an unusual task. That said, the framework should successfully execute the vast majority of SQL you throw at it.

50. Implement a JDBC Connection Pool via the Object Pool Pattern    developer.com

Some things in life are expensive. Take vacation condos for example. Everybody would love to have one of his or her own, but most of us can't afford it. The solution to the problem is the time-share. You might have the condo this week; I'll get it next week; and someone else the week after that. One condo, but we all share it. In the computing world, one of the most expensive things around is the database connection, and many databases and application servers share connections via connection pools. In this article, I will show you how to implement a pool based on the Object Pool pattern and develop a JDBC connection pool as an example.

51. Using JDBC with MySQL, Getting Started    developer.com

However, the installation and preparation procedures for different SQL databases vary widely. A large part of the battle in using JDBC with a particular database is getting the database installed and properly prepared for use with JDBC.

52. Converting JDBC Result Sets to XML    developer.com

With the background concepts on JDBC result sets and XML documents, we're ready to begin coding our example. We'll name our class JDBCUtil.

53. JDBC basics    developer.com

The Java Database Connectivity (JDBC) API is used to access databases from Java programs. There are several books available on the subject, but there are just a few things that you need to know to get started. In this article, we present the basics of using JDBC.

54. Build a Low Overhead Test Bed for Your JDBC Code    devx.com

Cloudscape got a lot of attention recently when IBM opened its source as Apache Derby. Cloudscape is ideal for testing your JDBC code as you'll learn in this article. And while some purists?those who swear by command line, vi editor development?might beg to differ, the majority of developers tend to agree that use of an IDE can catalyze your development effort. If you are already familiar with the Eclipse IDE, then getting up and running with Rational Application Developer won't be that big of a leap. You can download a trial version of Rational Application Developer 6 from http://www-128.ibm.com/developerworks/downloads/r/rad/. For this article, I will assume that you have some basic familiarity with Rational Application Developer. In addition to learning how to test your J2EE applications using Cloudscape, I will show you how to use a number of relational database tools innate in Rational Application Developer.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.