Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: JDBC/Oracle Tutorial 1

JDBC/Oracle Tutorial 1

Tutorial Details:

Java Database Connectivity (JDBC) is a standard API for accessing relational databases from a Java program. This interface makes it easy to access a database because it provides an abstract layer that hides the low-level details, such as managing sockets. It also provides for interoperability and portability since it allows a single application to access multiple database management systems simultaneously. For example, a single application can query and manipulate a database in Oracle and a database in DB2. Communication with a database management system (DBMS) is through method calls. These calls are passed to the driver, which in turn, translates them into DBMS-specific calls. The driver basically acts like a set of library routines. Therefore, to get your program to communicate with a particular DBMS, you need a compatible JDBC driver.

The basic steps to get your program up and running are:
Load the driver and register it with the driver manager
Connect to a database
Create a statement
Execute a query and retrieve the results, or make changes to the database
Disconnect from the database

Checking for Null Return Values
Although the above code snippet did not check for null return values, you should always check for nulls for all nullable columns. If you don't, you may encounter exceptions at runtime. The ResultSet class provides the method wasNull() for detecting fetched null values. It returns true if the last value fetched by getXXX() is null.
There are a few important things to consider when checking for nulls. The SQL NULL value is mapped to Java's null. However, only object types can represent null; primitive types, such as int and float, cannot. These types represent null as 0. Thus when NULL is fetched, getByte(), getShort(), getInt(), getLong(), getFloat(), and getDouble() return 0 instead of null. Moreover, the getBoolean() method returns false if NULL is fetched. What if the value stored in the database is actually 0 or false? To avoid this problem, use the wasNull() method to check for null values.



 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
JDBC/Oracle Tutorial 1

View Tutorial:
JDBC/Oracle Tutorial 1

Related Tutorials:

Displaying 1 - 50 of about 3089 Related Tutorials.

JDO UNPLUGGED - PART 1
JDO - Java Data Objects Tutorials, JDO Java Data Object, JDO Tutorial, JDO... JDBC and EJB with CMP and BMP. Also there are a number of ORM tools like... Oracle etc., In this article we shall the unique features of JDO and how
 
New Page 1
, but now is formally defined in JSP 2.0. In this tutorial you will learn... one is ${bigFive[0]} The second one is ${bigFive["1"]} EL Operators... = text name = "username"> <br>Address Line 1 : <input type
 
String Exercises 1 - Answers
Java: String Exercises 1 - Answers Java: String Exercises 1 - Answers Answers to the String Exercises 1. 3 -- s refers to exactly the same string as a. ERROR -- t
 
Beginners Java Tutorial
java Beginner,java Beginners,Beginning java,Beginners Java Tutorial,Java for beginners Beginners Java Tutorial...; This tutorial will introduce you with the Java Programming
 
FormatPanel Tutorial
Java: FormatPanel Tutorial Java: FormatPanel Tutorial Example 1 To start let's produce a simple example, a label and a text field that looks like this. The entire
 
Beginners Java Tutorial
java Beginner,java Beginners,Beginning java,Beginners Java Tutorial,Java for beginners Beginners Java Tutorial...; This tutorial will introduce you with the Java Programming
 
PHP Sorting Arrays Tutorial
_string: string comparison Example 1: <?php $car...; manza [1] => safari [2] => nano [3] => vista [4] => jaguar [5] => land rover ) After sorting values become: Array ( [0] => jaguar [1] => land
 
J2EE Tutorial - Running RMI Example
J2EE Tutorial - Running RMI Example J2EE Tutorial...;   How to compile and run the RMI-IIOP program? 1) We require...:      1) greeter.idl      2
 
Mysql Loader Tutorial
Mysql Loader Tutorial Mysql Loader Tutorial...; Mysql Loaded Tutorial is used to import a data to a plain text from Mysql..., 1 row affected (0.02 sec) mysql>insert into employee1 values(02,'Komal
 
Mysql Loader Tutorial
Mysql Loader Tutorial Mysql Loader Tutorial...;   Mysql Loaded Tutorial is used to import a data to a plain...'); Query OK, 1 row affected (0.02 sec) mysql>insert into employee1 values(02
 
Mysql Loader Tutorial
Mysql Loader Tutorial Mysql Loader Tutorial...; Mysql Loaded Tutorial is used to import a data to a plain text from Mysql... into employee1 values(01,'Girish','2008-12-20'); Query OK, 1 row affected (0.02 sec
 
Rico Tutorial
Rico Tutorial Rico Tutorial               ...:#00FFFF"> <div class="title">Drop 1</div> </div> <
 
Maven2 Tutorial
Maven2 Tutorial Maven2 Tutorial... organizations. This tutorial provides you introduction to Maven 2, shifting... to build a project Maven basics 1.     
 
Maven2 Tutorial
Maven2 Tutorial Maven2 Tutorial... organizations. This tutorial provides you introduction to Maven 2, shifting... to build a project Maven basics 1.     
 
GUI Tutorial I - FIRST DRAFT
Vanilla Java: GUI Tutorial First Draft Table of Contents GUI Tutorial I - FIRST DRAFT Table... after reading this tutorial. The tutorial presents model programs of increasing
 
J2ME Tutorial
J2me Tutorial J2ME Tutorial  ... is called. The example have two different options 1. "ok" and option 2...;  Radio Button in J2ME In this tutorial you will see the MIDlet
 
J2ME Tutorial
J2me Tutorial J2ME Tutorial  ... is called. The example have two different options 1. "ok" and option 2...;  Radio Button in J2ME In this tutorial you will see the MIDlet
 
Simple Linked List Exercise 1
Java: Simple Linked List Exercise 1 Java Notes: Simple Linked List Exercise 1 Name... strings and puts them in a doubly linked list. 1 2 3 4 5 6
 
Struts 2 Tutorial
Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2... in struts 2. A text area contains 1 to 250 characters. It cann't support "null"
 
PHP Getting Started With PHP Tutorial
with this quick and simple tutorial. Designed for the very beginners. What is PHP... type either : Example 1: <?php     print("I am learning...://roseindia.net/tutorial/php/phpbasics/tutorial/index.html or http
 
Struts 2 Tutorial
Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2... in struts 2. A text area contains 1 to 250 characters. It cann't support "null"
 
PHP File Manipulation Writing to a File Tutorial
;  In this tutorial we will learn how to write data to a flat file database (text document) using this tutorial.  In PHP, we can do many... form of file handling. Example 1 (Let's assume that we have created a .txt file
 
Photoshop Tutorial : Printer
in the Photoshop This tutorial will teach you to design a printer with easy step...:  Got to Layer menu> Layer Style > Stroke and set stroke 1 with black... menu > Layer Style> Stroke> set stroke 1. Final Image
 
Java - XPath Tutorial
Java - XPath Tutorial Java - XPath  Tutorial          ...; <person id="1">       
 
J2EE Tutorial - Introduction
J2EE Tutorial - Introduction J2EE Tutorial... want to know whether J2EE is Java atall or something else. This tutorial... long journey and this 'short' tutorial cannot cover   all
 
OOP Tutorial [first draft]
Java: OOP Tutorial Java: OOP Tutorial [first draft] Table of contents Introduction... implementation of Comparable. 1. Introduction Object-Oriented
 
J2EE Tutorial - Session Tracking
J2EE Tutorial - Session Tracking J2EE Tutorial - Session Tracking        ... one more layer.( we have 3 layers now).    1) The user's
 
Quick Hibernate Annotation Tutorial
; Note:- This tutorial covers only the Annotations part. The reader must have hands on experience before starting this tutorial. Introduction:- Hibernate needs... nvarchar(30) ); Step 1:- Creating Utility Class :- The following
 
Java read file line by line - Java Tutorial
; }--> Java read file line by line - Java Tutorial   ... reading and writing operation in a file. In the section of Java Tutorial you.... It returns -1 when the end-of-file has been reached. We typically use this class
 
Rationale for GUI tutorial decisions
Java: Rationale for GUI tutorial decisions Table of Contents Rationale for GUI tutorial decisions Java... about. 1 2 3 4 5 6 7 8 9 10 11 12 13
 
PHP Working with Variables Tutorial
examples of variable declaration and use are given below: Example 1: <?php
 
Struts 2 Tutorials for Beginners, Struts 2 Tutorial
Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2... in struts 2. A text area contains 1 to 250 characters. It cann't support "null"
 
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial.
/CORBA 1. Java Database Connectivity or JDBC... and tutorial on JDBC visit http://www.roseindia.net/jdbc/jdbc.htm... Architecture, EJB Tutorial, WebLogic Tutorial
 
Common Interview Questions Page -1
Common Interview Questions Page -1 Common Interview Questions Page -1       ...;       Question:1. Tell Me a Little
 
Difficult Interview Questions Page -1
Difficult Interview Questions Page -1 Difficult Interview Questions Page -1       ...;       Question 1: Tell me about yourself
 
Apache Geronimo Application server Tutorial
application dependencies making it easy to maintain and run applications. JDBC 3.0 New and improved JDBC 3.0 is now built into heart of Geronimo. Provides high performance Database connection. JDBC 3.0 now supports Metadata APIS, Named
 
String Exercises 1
Java: String Exercises 1 Java: String Exercises 1 Name...() __________ 1 + a __________ a.toUpperCase() __________ "Tomorrow".indexOf
 
Constructor Chaining Exercise 1
Java: Constructor Chaining Exercise 1 Java NotesConstructor Chaining Exercise 1 Name _______________________________ The first line of every constructor must be either
 
Mysql Not
Not is useful when you a perform Not Operation in SQL. The SQL query returns you 1 and 0,  when !o and !1 are selected in the select query. Understand with Example The Tutorial illustrate an example from 'MySQL Not'. The Select Query !0
 
Programming: Initials 1
Java: Programming: Initials 1 Java: Programming: Initials 1 Name ________________________________________ Write a program that asks for names and displays the initials. Ask the user
 
Dojo Tutorial
DOJO Tutorial Dojo Tutorial  ...; In this tutorial, you will learn everything about the dojo. After completing the tutorial.... This advanced Dojo tutorial covers: Introduction to DOJO
 
Buy Fedora Core 3 Test 1 Linux CD's in India.
Buy Fedora Core 3 Test 1 Linux CD's in India. Fedora Core 3 Test 1 Linux Fedora Core 3 Is Available Now Available Fedora... Test 1 Linux CDs, which is distributed under GNU public license. ABOUT FEDORA
 
PHP Displaying the date and time in your timezone Tutorial
( [0] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Porto_Acre ) [1] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Eirunepe ) [2] => Array ( [dst] => 1 [offset] =>
 
PHP Generate a pages loading time Tutorial
the initial time and final time, and everything will be sorted. Examples 1: <?php...] + $m_time[1]; $starttime = $m_time; $m_time = explode(" ",microtime()); $m_time = $m_time[0] + $m_time[1]; $endtime = $m_time
 
Quartz Tutorial
Quartz Tutorial, Quartz Scheduler, Quartz Job Scheduler Quartz Tutorial        ...;      In this Quartz Tutorial you will how
 
Quartz Tutorial
Quartz Tutorial, Quartz Scheduler, Quartz Job Scheduler Quartz Tutorial        ...;      In this Quartz Tutorial you will how
 
Java Java DOM Tutorial Tutorial
XML,XML Tutorials,XML Examples,XML Example,Java DOM Tutorial Java DOM Tutorial        ...;      This tutorial is complete guide to DOM
 
WEBSERVICE USING APACHE AXIS - TUTORIAL-2 AXIS FOR EJB-WEBSERVICE (part-5)
had seen parts 1 to 4 of this tutorial on exposing an EJB as XML-Webservice... objective in? this part of the tutorial.. ( Kindly read this lesson, in conjunction... to opening remarks in part-3 of this tutorial in March-2004 issue). We now? give
 
Collections Exercise 1 - Unique Components
Java: Collections Exercise 1 - Unique Components Java: Collections Exercise 1 - Unique Components Name ____________________________________ For the purposes of this exercise, the only
 
Java Interview Questions - Page 1
Java Interview Questions,interview questions java Java Interview Questions - Page 1     ... value would be variable a because the x is 1 and less than y = 2; the x < y
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.