if we don't close the connection , it wil lead to connection memory leakage.unless until application server/web server is shut down ,connection wil remain activate even though the user logs out .
Ans:Loading a class in JDBC For getting connection to database and to query database for INSERT,UPDATE,DELETE and to do some operations on database through java programs you need to load the jdbc driver class for a particular database provided by the database provider for that you use class.forName() Method this method will load the class which are necessary for database operations
JDBC mean Java Database Connectivity. In java, using JDBC drivers, we can connect to database. Steps to connect to JDBC. 1) Load the driver, using Class.forName(DriverName); 2) Get the connection object, Connection con = Driver.getConnection(loaded driver name); 3) Create a SQL statement, Statement s = con.createStatement(); 4) Create Resultset object using the statement created above, ResultSet rs = s.executeQuery("sql statement"); Iterate the result set to get all the values from the database. Finally don't miss this 5) s.close(); 6) con.close() ;
JDBC is java database API, while JNDI is java native directory API. The main thing in here is that in a JNDI directory you're actually storing a JDBC DataSource, so, you're simply using JDBC and obtain a Connection via JNDI lookup. In short words: JDBC is Database realm, JNDI lets you store Objects in a virtual context (the Directory) that can be local, remote (Implementation details usually don't matters). You access this context via names, obtaining stored objects, is good to share things among different modules. Application Servers usually have a JNDI Context for sharing global objects amon different application, Connection Poolers happen to be one of the most clear example of why sharing via JNDI is good. (Define 1 connection pooler, share between several webapps)
JDBC stands for Java Database Connectivity . It was developed by Java soft and is a part of Java Enterprise API. JDBC is the first standardized API that allows the users to develop database front ends without continously rewriting their code. JDBC provides the ability to create robust, platform-independent application and wev-based applets, wihich can acces any database through a DBS-independent mechanism. The interaction between these application and applets with SQL data sources is done through a set of relational database objects and methods defined is the JDBC API.
How many 3s in 313433535333?
Who would you swap lives with for a day?
Is it true that one human year is equal to seven dog years?
What is the name of the movie filmed in weslaco Texas where cornelio reyna sang?
What is the answer to this India foxtrot Yankee Oscar uniform charlie alpha November uniform November delta echo romeo sierra tango alpha November delta tango hotel India sierra charlie Oscar papa yan?
Din se roshan hai raat se andhari hai khao to haram hai peo to halal hai aurat sari zindgi you use 1 bar use karti hai aur mard din you 3 bar use karta hai quran you uska 5 dafa zikar hai?
A farmer has 19 sheep All but 7 die How many are left?
What is the net worth of the Collingsworth Family gospel singers?
Can eggs break inside a chicken?
Why do books come out in hardback first?
What happens when a beehive gets too full?
What is the difference between an optometrist and an ophthalmologist?
How can you tell when someone's lying?
Why do some people celebrate Christmas in July?
Why is it bad luck to walk under a ladder?
What is a conservatorship?
What is time signature of ncr hymn?
Is Gianluca Ginoble gay?
Paano umusbong ang pagmamahal sa karunungan?
Why the eastern Terai is cooler than than western one OF NEPAL?
Who was giani maan singh jhaur?
What happened to Jeff Hewson of QVC fame?
Is the Montgomery Bus Boycott capitalized?
How do you get admission in junior college in pune?
Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.