JDBC Drivers:What are they?

JDBC has been a widely used API since long for interaction between Java Programs and various Databases.

From a Java programmer’s perspective,JDBC API serves the following mentioned functions:

  • Loading the appropriate JDBC Driver
  • Creating connection with a database or a table based datasource.
  • Sends SQL Statements to the database/source.
  • Processing of the retrieved results.

Loading the driver is accomplished either by setting the jdbc.drivers system property, or by dynamically loading the appropriate driver class with a call to Class.forName().

try {
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 Class.forName("com.oracle.jdbc.OracleDriver");
}
catch (ClassNotFoundException e) {
 /* Handle Exception */
}

Type of JDBC Drivers

There are essentially four different types of JDBC Drivers which are categorized as

1.) Type 1/JDBC-ODBC Bridge plus ODBC Driver: This combination provides JDBC access via ODBC drivers. ODBC binary code — and in many cases, database client code — must be loaded on each client machine that uses a JDBC-ODBC Bridge.

Type1 Driver

Sun provides a JDBC-ODBC Bridge driver, which is appropriate for experimental use and for situations in which no other driver is available.

Type 1 drivers use a bridge technology to connect a Java client to an ODBC database system. The JDBC-ODBC Bridge from Sun and InterSolv is the only existing example of a Type 1 driver. Type 1 drivers require some sort of non-Java software to be installed on the machine running your code, and they are implemented using native code.

2.)Type 2/A native API partly Java technology-enabled driver: This type of driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS.

Type 2 Driver

Note that, like the bridge driver, this style of driver requires that some binary code be loaded on each client machine.

Type 2 drivers use a native code library to access a database, wrapping a thin layer of Java around the native library. For example, with Oracle databases, the native access might be through the Oracle Call Interface (OCI) libraries that were originally designed for C/C++ programmers. Type 2 drivers are implemented with native code, so they may perform better than all-Java drivers, but they also add an element of risk, as a defect in the native code can crash the Java Virtual Machine.

3.)Type 3/Pure Java Driver for Database Middleware: This style of driver translates JDBC calls into the middleware vendor’s protocol, which is then translated to a DBMS protocol by a middleware server.

Type 3 Driver

The middleware provides connectivity to many different databases.

Type 3 drivers define a generic network protocol that interfaces with a piece of custom middleware. The middleware component might use any other type of driver to provide the actual database access. BEA’s WebLogic product line (formerly known as WebLogic Tengah and before that as jdbcKona/T3) is an example. These drivers are especially useful for applet deployment, since the actual JDBC classes can be written entirely in Java and downloaded by the client on the fly.

4.)Type 4/Pure Java Driver: This style of driver converts JDBC calls into the network protocol used directly by DBMSs, allowing a direct call from the client machine to the DBMS server and providing a practical solution for intranet access.

Type 4 Driver

Type 4 drivers are written entirely in Java. They understand database-specific networking protocols and can access the database directly without any additional software. These drivers are also well suited for applet programming, provided that the Java security manager allows TCP/IP connections to the database server.

Java Related Reads:

Java: Lifecycle of a Java Program

Why Java?

How to get free available memory in Java program

How do I declare a constant in Java

Wat is the difference between JDK and JRE?

Write a Java Application without a main() method

[Content References: Sun , OnJava]

[Image Source: Answers.com]

In my coming posts, i will try to share more about Java and JDBC with you.
Cheers,

Vaibhav

Send Free SMS using Yahoo Mail

Few days back i had written a post about sending free SMS in India using 160by2 and Way2Sms in my post Send Free SMS in India using 160by2 and now, I just checked and found that Yahoo Mail too has added another feature of sending messages to your Mobile Phone.

SMS Through Yahoo Mail

Follow the below mentioned steps to send Free SMS using Yahoo Mail.

  1. Login to your Yahoo Mail account (Yahoo Mail beta and not the classic one)
  2. Click on the New Drop down and select TextMessage.
  3. Add the number/contact to which you wish to send the message and click on send.

Its FREE but the catch is that you can only send maximum of 5 sms to a contact after which your contact person needs to reply at least once and then your quota of 5 starts all over again. Although, am not sure of the pricing as far as the reply message is concerned.

This feature is available only for Yahoo users in India,Canada, US and Philippines.

Yahoo mail definitely according to me is going places as compared to Gmail. Lets see who races further ahead in this race of better email service.

Related reads: Send Free SMS in India using 160by2

Email2SMS: Send Free SMS in India using Email.

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav

Philips DCD778: Under-Cabinet iPod Docking System

I wrote about Bose’s iPod Docking Station a few days back in my post Bose’s iPod Docking Station: A clear winner. In this post, i shall be writing about yet another iPod Docking Station (Philips DCD778) which was released by Philips a few months back.

Philips DCD778

Philips DCD778 according to the company is a device which is designed to be used in the kitchen and can be mounted under any cabinet. Following are some of the features of this entertainment system

  • Includes 8.5 inch LCD Display.
  • Capable of adding TV, AM and FM tuning.
  • DVD Playback.
  • Dual Speakers
  • 40 button Remote control.
  • Silver design to match many contemporary cabinet designs. ( This is a good feature as the product is indeed an “under cabinet”
  • iPod Adapters.
  • Cooking timer with a Clock

Philips claims the DCD778 Dock Station is compatible with fourth and fifth-generation iPods, iPod minis, and iPod nanos.

Philips DCD778 is available in US for a price around 300$.

Related Posts:

Are you a Musician looking for Audience? Turn to Muziboo.com

Bose’s iPod Docking Station: A clear winner

Do let me know about other docking systems and i shall include it in the Reader Contribution section.

Cheers

Vaibhav

Sync your Google Calendar with your PDA,use Goosync

Goosync is an amazing service which can be used to synchronize your Google Calendar with your PDA/mobile.

Goosync

GooSync seamlessly synchronizes almost any mobile device with your Google Calendar over the air so that you are always with your vital calendar.

In this post, i will briefly try to describe the service.

In order to sync your mobile calendar with your Google Calendar, you need to follow the below mentioned 3 easy steps:

GooSync-Howitworks

  1. Create your Google Calendar entries.
  2. Create your Goosync account.
  3. Initiate the sync using your mobile.
  4. Bingo!!! Thats it 🙂

Basic service of Goosync is free, however, You are only able to synchronize your primary Google Calendar and you are limited to a sync window of 7 days past and 30 days future of the current date. Upgrading to a premium accounts gives support for multiple calendars.

You can check out here if your mobile phone is supported by Goosync.

Go ahead and try out Goosync.

Do comment and share your experiences or if you know of any service better than Goosync.

Cheers,

Vaibhav

How-To: Save your mobile battery

Usually, mobile phone batteries drain out exactly when we want them the most. However, there are a few things that can be done in order to make you get that last mile from your battery before it drains out completely.

Battery

[Image Source: Good-Battery]

I am putting below some settings which can certainly help you get around 50% more from your battery.

  1. Turn off your Infrared and BlueTooth when not in use. Even when they are not in use, they do keep drawing power looking for signals.
  2. Switch off the vibration alerts. Vibration causes a lot of power usage thereby making battery drain fast.
  3. Re-adjust your screen brightness to around 50%. Screen power is another silent killer.
  4. Usually, presetted Backlight durations are of pretty high order, this can be readjusted to get more from your battery. Try reducing the Backlight duration.
  5. Often we don’t understand that playing games requires Light, Sounds and Shakes. This in turn leads to tripling of battery drainage.
  6. Lower Ringing and other message sounds. This too helps saving a lot of battery.
  7. Finally, do charge your battery before it gets drained fully. This enhances battery life.

[ Reader Contributions]

Betathetamu says “Another important factor is call volume. I have noticed that most people have the call volume set to maximum. I don’t have to actually check the volume bars because I can hear the other party as if the loudspeaker is on and is set to min. level. This not only shortens talk-time, but also drains battery faster than anything else. 50% call volume is usually more than sufficient to hear the other person clearly. If you work in a noisy environment, try using handsfree instead of maxing out call vol”.

Do comment and let me know your tricks on this.

Cheers,

Vaibhav

Various Forms of URL: Tiny, Huge and Ugly

Yeah, the title might be a little confusing but the intent of this post is clear. I intend to bring to you two services which are related to URL Lengths.

Related URL Posts: URL Deobfuscator

The two services which I am going to talk about in this post are TinyURL and HugeURL.

  • TinyURL, as the name suggests is used to shorten the length of the URL making it more easy to read and usable as well.
  • HugeURL on the other hand, is a service, which can be used to make a URL look cryptic, long and UGLY as well ( all forms in one URL).

Let me now write little about the features both these services provide.

TinyURL which definitely is one of the most and widely used service these days provides the following features:

TinyURL

[Image Source:Holamun2]

  • TinyURL shortens a cryptic looking URL to make it look more readable.
  • TinyURL can be added to your browser’s toolbar.
  • Redirect to any page in your website.
  • Hiding affiliate links.

HugeURL on the other hand is often not much heard of service. But again, you never know when you might use such services as well.

Examples

Let’s assume that the URL intended to be reformed is https://technofriends.wordpress.com/2007/10/21/my-list-of-5-best-firefox-extensions/

Using TinyURL, the URL becomes http://tinyurl.com/2pp24n

Using HugeURL, the URL becomes

http://www.hugeurl.com/?ZjFhNGQyYzc4ZjYyODc5NDM2NTVkMTg5OTY4
ZjE5ZWUmOSZWbTB3ZUdReFNYaGlSbVJZVjBkNFZWWXdaRzlYUmxsM1drWk9W
VTFXY0hwWGEyTTFWakpLU0dWR1dsWmlXRkYzVmpCYVMyTXlTa1ZVYkhCWFZt
eHdV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lUVlZrVjFkSGFHRmFWM1JoWld4c05sSnRkR3Bp
VmtwSVZrZDRhMkZXU2xsUmJIQlhUVlp3V0ZsVVJrcGxSbkJKVkd4b1dGSXhT
bHBYVjNSaFpERlplRmR1VWs1V2VteHlXV3RhZDJWc1dYbGtSRUpvVFZWd2Vs
WXlOWE5aVmtwWFkwZG9WMVpGY0VkYVZWcGhWbFpLYzFwR1pGZGlhMHBKVm10
U1IxbFdSWGhXYms1U1lrWmFUMVZyVWtKUFVUMDk=

Both the above forms finally point to the same URL only. So if you have any URL’s to be shortened/lengthened go ahead and try it out.

Related URL Posts: URL Deobfuscator

Cheers,

Vaibhav

What are Cabinet files?

If you have ever installed Windows Operating System on your PC/Laptop, you know that cabinet files (.cab) form a major part of this installation. However, often, we are not aware of what exactly these cabinet (.cab) files are all about.

In this post, i will try to share with you my knowledge about .cab files.

A cabinet file is a library of compressed files stored as a single file. Since very long, Microsoft has used .cab files in order to compress the files distributed on disks.

Cabinet Files

Usually, one of the files in the .cab file is the info (.inf) file, the info file is used to provide further installation information. The info file can refer to other files within the cabinet file or to a different URL itself.

Three compression formats are allowed for Cabinet (.cab) files:

  • DEFLATE
  • LZX
  • Quantum.

Unlike ZIP, ARC, LZH, TAR or other more generic compression formats, CAB files are a Microsoft invention that are generally used for storage of Microsoft-specific products.

You will likely see a number of different CAB files in the \Windows\Options\Cabs\ folder, including some used for storing drivers and various other things, including CAB files from third party software vendors.

If you are curious about the contents of a particular CAB file, you can use Windows Explorer or My Computer to view them. Simply browse the \Windows\Options\Cabs\ folder and double-click on whichever CAB file you’re interested in. Windows will automatically run the CabView program to allow you to view the contents of the selected CAB file.

If you have WinZip installed, the WinZip program will display the file contents instead of Windows’ CabView.

If would like to learn more about CAB files, you can find an enormous amount of information on the Internet as well as computer-related books.

Cheers

Vaibhav