Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Monday 1 October 2012

Connect Oracle10x Database using JSP

// siddhu vydyabhushana // Leave a Comment
As per requesting am going to show how to connect Oracle10g using JSP.
Before u nedd to download and install it 

Download: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win32soft-098987.html

using Above link first download and install it . after first configuration is needed,for that 

START----->My Computer----->Os Drive (C or D)-------> Programming Files-----

-->Oracle----->Product--->10.2.0.----->server----->Jdbc----->lib

copy the path as below

C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc.jar;.;

copy the above code and paste it in EnvironMent Variables


Goto Right Click on My Computer----->Properties------>Advanced System 

Settings------->Environment Variables-----> Find Path in System Variables the

and paste the above in path field if there is any path u use ; (Semicolon) to

differentiate

for eg:


D:\ProgramFiles\Java\jdk1.6.0\bin  ;

C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc.jar;.;





JSP CODE:

just for demo am showing this in further post i will give brief info....

Class.Forname:

               Class.forName("oracle.jdbc.driver.OracleDriver");

Connection: 
for creating connection b/w user and database in jsp we need to write this type of code ,we are getting connection for decvice driver for that we used 
DriverManager.getConnection

we are getting connection using URL:- jdbc:oracle:thin:@localhost:1521:XE

On installation we gave Username and Passwor d to Protect ur DB.




Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:15 21:XE","Username","Password");
Read More

How to use MSAccess as Database

// siddhu vydyabhushana // 4 comments

Microsoft Access is one of the part of  MSOFFICE  .It is a database management system from microsoft that combines the relational microsoft jet database engine with a graphical user interface and software development tools. we can also use this as oracle ,mysql database.... in first i used this one but present i addicted to php......for beginners it is very useful  and interesting no use to write code for creating tables.....................


Login and Regisration Using Jsp:-


NAME YOUR DATABASE:  open MSACCESS in microsoft office 
                              
         START->>>MICROSOFT OFFICE-->>msaccess

after that choose blank database and save it with example.accddb extension


CREATE TABLE :   After RIGHT CLICK ON table1 and take Design View to create table.there is no need to write commands create table.


after clicking design view u can edit like this

and rename table1 with whatever u like 

u create table and save the database in certain folder i am going explain to place it in tomcat   server.for example if u name as example.accdb...u need to place it in
folder of web apps


CONFIGURATION: 
                         Go to Control Panel -->and choose small icons instead of lage->> at next 
click on Administrative Tools   and select Data Sources


Click on Add to add database ---------------------------------------------------------



add *.mdb ,*.accdb Microsoft Access Driver and Finish.

in Data Source Name u choose name Whatever u like it will be used to call database in jsp.

                                                   
Connection con=DriverManager.getConnection("jdbc:odbc:example","","");


on 4 line Database:
                                Select and set path where database was u successfully configured 
if u have any doubts regarding to this topic leave doubts..





Siddhu vydyabhushana please subscribe to get this type posts to ur mail ...





Read More