Wednesday, April 28, 2010

Edesia -The Latest Project on Cards

It all start with a small circle of life which brought me my first "commercial" project of CMS development.It`s about a food and beverage consultancy firm named EDESIA Ventures who wanted a website and they came in contact with D2C a startup from few students of CBS College for whom I developed some posters and did online publicity during their fest and this D2C is started by the fest`s organizer so they recalled me through Harsh(my best friend).

Tough I agreed and quoted my prices according to the Restaurant Firm and started developing for same but when I went with D2C to the clients we both realized they wanted a website for the consultancy firm :) and everything just got messed up but then I didn`t wanna loose the project so I presented them with CMS and somehow wanted to compensate on my quote as I have quoted prize for HTML stuff but I didn`t wanna spoil D2C image nor mine so ..............

I know it`s not a good business tactic but I think I`l do better next time,then what more on 23rd I had to begin on prototype and today I showed them and it was accepted and I was able to win their confidence.
The protype is still in development stage I`l reveal the URL as soon as it gets online for world

Monday, April 26, 2010

More JAVA Notes

Friends I have searched for some e-books and notes of various authors and college i will be soon be posting them here
below i have posted a link do download it its an e-book of guide to java,may come handy

Click to download E-book

Friday, April 23, 2010

IP university BCA`s JAVA`s special Notes

What is JDBC?

The JDBC ( Java Database Connectivity) defines an application programming interfaces and classes for connecting java programs with database.

Using JDBC programmers can send SQL, PL/SQL statements to almost any relational database. JDBC can be used for executing SQL statements. It supports the basic SQL functionality. It provides RDBMS access by allowing programmers to embed SQL inside Java code.

JDBC Architecture

JDBC drivers

JDBC drivers are divided into four types . The different types of jdbc drivers are:

Type 1: JDBC-ODBC Bridge driver (Bridge)
Type 2: Native-API/partly Java driver (Native)
Type 3: AllJava/Net-protocol driver (Middleware)
Type 4: All Java/Native-protocol driver (Pure)

Type 1: JDBC-ODBC Bridge driver

The Type 1 driver translates all JDBC calls into ODBC calls and sends them to the ODBC driver.

Advantage

The JDBC-ODBC Bridge allows access to almost any database, since the database's ODBC drivers are already available.

Disadvantages

1. Since the Bridge driver is not written fully in Java, Type 1 drivers are not portable.
2. They are the slowest of all driver types.
3. The client system requires the ODBC Installation to use the driver.
4. Not good for the Web.

Type 2: Native-API/partly Java driver

The Type 2 drivers convert JDBC calls into database-specific calls. This driver is specific to a particular database. Example: Oracle will have oracle native API. (native API means Database Library API)


Advantage

The Type 2 JDBC drivers offer better performance than the Type 1.This is because of two reasons

1. The layers of communication in Type 2 are less than that of Type 1 .

2. It uses Native API which is Database specific.

Disadvantage

1. Native API must be installed in the Client System and hence type 2 drivers cannot be used for the Internet.

2. Like Type 1 drivers, it’s not written in Java Language which forms a portability issue.

3. If we change the Database then we have to change the native API as it is specific to a database

Type 3: All Java/Net-protocol driver

Type 3 drivers accepts calls from JDBC and passed through the network to the middle-tier server(middleware component). The middle-tier then translates the request to the database. The middle-tier server can in turn use Type1, Type 2 or Type 4 drivers.

Advantage

1. This driver is server-based, so there is no need for any vendor database library to be present on client machines.
2. This driver is fully written in Java and hence Portable. It is suitable for the web..
3. The net protocol can be designed to make the client JDBC driver very small and fast to load.
4. This driver is very flexible allows access to multiple databases using one driver.
5. They are the most efficient amongst all driver types.

Disadvantage

It requires another server application to install and maintain. Traversing the recordset may take longer, since the data comes through the backend server.

Type 4 : Native-protocol/all-Java driver

The Type 4 driver uses java networking libraries to communicate directly with the database server.

Advantage

1. The major benefit of using a type 4 JDBC drivers are that they are completely written in Java to achieve platform independence

2. It is most suitable for the web.

3. Number of translation layers is very less i.e. Type 4 JDBC drivers don't have to translate database requests to ODBC or a native connectivity interface or to pass the request on to another server.

4. performance is also good.
3. No need to install special software on the client or server. Further, these drivers can be downloaded dynamically.

Disadvantage

With type 4 drivers, the user needs a different driver for each database.

Java Database Connectivity Steps

1. Before creating a java jdbc connection to the database, programmers must first import the java.sql package.

import java.sql.*;

2. . Loading a database driver.

Programmers can load the driver class (java.sql.Driver) by calling the method Class.forName() .This method has Driver class name as an argument. Class is a class in java.lang package.

Syntax for loading driver

try

{

Class.forName(”sun.jdbc.odbc.JdbcOdbcDriver”);

}

catch(Exception x)

{

System.out.println( “Unable to load the driver class!” );

}

3. Creating a Connection

The JDBC DriverManager class defines objects which can connect Java applications to a JDBC driver.DriverManager is considered the backbone of JDBC architecture. DriverManager class manages the JDBC driver.

DriverManager’s getConnection() method is used to establish
a connection to a database.

Syntax:

DriveManager.getConnection(URL). The URL always has three parts.

Protocol:subprotocol:subname

Protocol is always JDBC.

Subprotocol is used for specifying the type of driver .

Example:If the driver is JDBC-ODBC bridge then the subprotocol must be odbc.

Subname is used to identify the database.

4.Creating Connection object

Once a connection is obtained user can interact with the database.For the interaction with the database Java implements Connection interface.The methods defined in the Connection interface helps programmer to interact with the database through the established connection ( DriveManager.getConnection) .

ie Connection c=DriveManager.getConnection(URL)

5.Creating Statement object

Statement is an interface defined in sql package.This interface has createStatement() method.This method helps to creates an SQL statement object from the Connection object .

ie Statement st=c.createStatement();

The Statement object st is used to send and execute SQL statements to a database.

6.Executing SQL statements using Statement interface

Statement interface defines three methods to execute the SQL statements.

They are

1. executeQuery()- executes SELECT statement .

2. executeUpdate()-executes statements that create or modify tables,

3. execute()-executes an SQL statement that is written as String object

ie st.executeQuery("select * from Employees");

executing the SQL statement and sendind to database using st.

7.Resultset

Resultset is an interface defined in sql package. It provides access to a table of data generated by executing a Statement interface. When we execute a SELECT statement with the executeQuery() method, it will return a Resultset object. The data in a ResultSet object is organized in rows and columns.

ie r=st.executeQuery("select * from Employees");

In the above statement r is pointing to the Employees table.

Resultset defines a method next().

r.next() - Move the cursor to the first row

Example :

Connecting MS-Access database using JDBC

import java.sql.*;

public class jdbc1

{

public static void main(String args[])

{

ResultSet r;

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection c=DriverManager.getConnection("jdbc:odbc:emp");

Statement st=c.createStatement();

r=st.executeQuery("select * from Employees");

while(r.next())

{

System.out.println(r.getInt(1)+"\t"+r.getString(2)+"\t"+r.getInt(3)+"\t"+r.getString(4));

}

}

catch(SQLException e)

{

System.out.println("SQL Error");

}

catch(Exception e)

{

System.out.println("Error" +e);

}

}

}

output:

C:\Program Files\Java\jdk1.5.0_07\bin>javac jdbc1.java

C:\Program Files\Java\jdk1.5.0_07\bin>java jdbc1

1 MCA 122 ee

2 MBA 125 hh

Important points

1. what are the differences between ODBC and JDBC?

1.ODBC(OpenDatabaseConnectivity) is for Microsoft and JDBC(Java DatabaseConnectivity) is for java applications.

2.ODBC can't be directly used with Java because it uses a C

Interface

3.ODBC makes use of pointers which have been removed

totally from java.

4.ODBC requires manual installation of the ODBC driver

manager and driver on all client machines.JDBC drivers are

written in java and JDBC code is automatically

installable,secure,and portable on all platforms.

5.ODBC is procedural oriented and JDBC is object oriented.

2.Explain the different drivers in java?

3.Create databaseconnectivity using JDBC?

Sunday, April 18, 2010

19th April an Important Day For "INDIAN SPACE PROGRAM"

It`s been 35 years since now when India first satelite was launched,named Aryabhatta named after the famous Indian astrologer.The soviet union put the satelite in the orbit on19th April 1975 .Satelite was devlopped by ISRO for astonomy studies.

India has since produced worlds finest satelite and landed an Indian owned object on to the moon and made Chandrayan-1 revolve around moon whihc was great success as it proved the presence of water on it.
Ou rockets have also been of great resource which have ferried a record 12 sateleites at a go.

Saturday, April 17, 2010

Rulers Of India Being Ruled by An indian

For 200 hundred years east India company rules India and its just a month back when an indian has bought the east India company and now he is the new CEO,chairman of the company and he is none other than Sanjeev Mehta.

Acutely aware that he now owns a piece of Indian history - at its height the company had half of world trade and employed a third of the British workforce - Mehta, now the sole owner, is paving company's rich and ruthless past in order to give it a new lead for the future.

for more information visit

Tuesday, April 13, 2010

A post after a long time

It been a long time I wrote my last blog.I dont know why but didn`t wanna right no this one i mean on sudarshanbengani.blog...... so i have shifted to iamsud.blogspot........ where I write more freely and since i have got google adsense so I m trying to write in more and more stuff.
Well yesterday I organised with Abhinav Dhandh ,microsofts live feed from bangalore to JSS my college whihc was first time for college and for me as well.

Thursday, April 1, 2010

I Got Adsense Confirmation

It seems that the current financial year has kicked of well for me and i have got some good offers and also google adsense confirmation.Well google adsense confirmation was good thing for me as now i can post adds on my blogs and expect people to land up searching for some material on my blog.I know its a very rear chance but when so ever it happens I would be pretty relaxed and happy as I was trying for it for quite a long time.