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
ZjE5ZWUmOSZWbTB3ZUdReFNYa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WWtad2NGWnFTbTlWUm1SWVpF
WmthMDFFUWpSV01qVlRZV3hLVms1WE9WVldWa3BJVldwR1UxWXhXblJrUjJo
WFlYcFdTRmRVUW10aU1WcHlUVlZrVjFkSGFHRmFWM1JoWld4c05sSnRkR3Bp
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

DIY: Build your own Sputnik style Satellite

BBCNews has an interesting post on their site about building your own Sputnik using the most commonly found household items. I am trying to summarize the entire post below. The entire post can be read here

Sputnik

As per this interesting post, the Sputnik satellite can easily be summarized as:

  • Metal Sphere almost 61 cm in Diameter.
  • Had a Radio Transmitter.
  • Also had a battery.
  • Equipment to measure Temperature and Pressure
  • Pressure and Temperature activated switches.
  • A fan to avoid overheating.
  • Sent “beep beep” signals indicating sudden shifts in temperature or a pressure change owing to puncture of the metal sphere.

Now, in order to create your own Sputnik style satellite all you need to do is go ahead and get stuff which can replace the above mentioned summarized items.

So here goes the list which can be used to go ahead and get your own Sputnik.

  • Transmitters can be used from Mobiles, Baby monitors, wireless routers or cordless phones. All these instruments do have such transmitters which are used to send back the signal to the base station.
  • Temperature switches can be used from Thermostat’s from your favorite IRON, Washing Machines, Electric Oven etc.
  • Party Balloon can be used as a pressure switch. As the pressure outside drops, a partially inflated balloon shall certainly expand and burst.
  • Fan’s can easily be found from your CPU’s cooling unit.
  • Batteries too can easily be found from your computer UPS or Laptop.
  • Metal sphere can also be easily found at your favorite Hardware shop.

Sputnik

 

1. Tomy baby monitor – transmitter and aerial

2. Wireless router – backup transmitter and aerial

3. Mercury thermometer – temperature sensor

4. x4 large batteries – power supply

5. Balloon – pressure sensor (expands and pops if case punctured)

6. Power-pack – backup power supply

7. Domestic thermostat – activates fan and changes radio signal

8. Battery powered fan – moves heat to casing (once tin lid is on)

9. Biscuit tin with foil – houses components and reflects solar radiation

Though, all these summarized items look easy to find, the real challenge as always lies in assembling the components and programming them to work in the desired manner. The picture above from the post, gives a rough sketch of how your own Sputnik might look.

Go ahead and read more for further details here

Cheers,

Vaibhav

How-To: Listen Internet Radio in your GTalk,MSN/Live IM or Yahoo IM

 

Yes, this is true. Google Talk/Yahoo IM/MSN/Live IM can be used to listen to Internet Radio as well. This is possible using GTalk2VoIP service.In order to do so, all you need to is follow the steps mentioned below:

  1. Add service@gtalk2voip.com to your contact list. In case you are not comfortable with adding a contact in your IM, the other way out is to go to http://www.gtalk2voip.com/ and enter your details in the Subscription form to get an invite.
  2. Send RADIO command to service@gtalk2voip.com to get list of available radio stations, remember a numerical ID of any.
  3. Send RADIO ID command to service to get connected.
  4. Accept incoming call from the service.

Fig: Chat conversation as listed aboveGtalk radio

For Google Talk users: Google Talk users can invite radio station contact into their list of contacts by adding a contact like: ID@radio.gtalk2voip.com (i.e. 100@radio.gtalk2voip.com). When contact appears online, press Call button to connect to the radio station.

LIST OF AVAILABLE RADIO STATIONS:

100 181.fm – Kickin’ Country (Todays Best Country!)

101 1.FM – Country

102 Atlantic Sound Factory – ASF Radio

103 100.7 Jack FM, San Diego

104 102.7 FM The Fringe

105 181.fm – The Buzz (Your Alternative Station!)

106 181.fm – The Mix Channel (70s, 80s, 90s and Today’s Best Music)

107 181.fm – The Eagle (Your Home For REAL Classic Rock!)

108 .977 The 80s Channel

109 1.FM – Channel X, Hindi Radio

111 Radio Helsinki – 92.6 MHz

201 KCRW World News

202 Sporting News Radio

203 KPFK – Southern California’s 90.7 FM News, Talk & Music

204 WBUR 90.9 FM, Boston’s NPR News Station

205 TalkRadioX

206 Arabian HIT 96.7 FM, Dubai

Try it out and do share your views.

Cheers,Vaibhav

Top 5 Tutorials on Ruby on Rails

Ruby on Rails is a new kid in the block into the world of Web application development that is rapidly gaining interest, even though it is in beta versions. These days, I am trying to get my hands dirty with Ruby on Rails using various tutorial posts and also some books. Over the coming days, i will try to share my learnings with you through the blog.

Ruby On Rails

Below, in this post, I am putting up a list of Top 5 Tutorials to get you started on Ruby on Rails (RoR). These are infact tutorials, i am going through in order to learn RoR.

  1. Ruby on Rails Tutorial for Newbies: This tutorial is a basic tutorial targeting the newbies in RoR arena.
  2. OnLamp’s Tutorial-Rolling with Ruby on Rails: Author Curt Hibbs has given an excellent post on RoR in his tutorial. Check it out, it a must to read tutorial.
  3. Rolling with Ruby on Rails, Part 2: Second part of the Tutorial by Curt Hibbs
  4. OnLamp’s Tutorial -Ajax on Rails: Author Curt Hibbs in again another useful tutorial introduces the incredibly easy-to-use Ajax support that is part of the Ruby on Rails web application framework.
  5. Fast-track your Web apps with Ruby on Rails: IBM Developerworks tutorial on Ruby on Rails.

Hope you have a good time reading. Do share your own findings and learning links as well.

Cheers

Vaibhav