Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is jdbc?

Answers were Sorted based on User's Feedback



what is jdbc?..

Answer / nagendar.m

Hi ammu the interviewer doesn't mean to ask the abrivation
of the jdbc.
see, i can justify my ans for this Q? hav a look.

jdbc is an API provided to connet various DB's from a java
program and as part of jdbc there are 4 types of drivers
avilable to connect DB.
>Type-I to Type-IV
>in projects we use Type-IV driver which is called Thin
driver OR we use the combination of thin and Type-III
driver.
>Sample code: Using Thin driver and Oracle DB.

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

String url="jdbc:oracle:thin:@localhost:1521:server";

Connection connection=DriverManager.getConnection
(url,"SCOTT","TIGER");

PreparedStatement ps=connection.prepareStatement("SELECT *
FROM EMPLOYEE");

ResultSet rs=ps.executeQuery();

i think this Explination is fine...

Is This Answer Correct ?    28 Yes 0 No

what is jdbc?..

Answer / ammu

java database connectivity

Is This Answer Correct ?    18 Yes 7 No

what is jdbc?..

Answer / vishal

2nd and 3rd both answer is correct.

Is This Answer Correct ?    3 Yes 0 No

what is jdbc?..

Answer / rice

Java database connectivity is a service technology from sun
micro systems.
It is a J2EE service technology from sun micro systems.

The main objective of this service technology is to persist
the Java Object state into the file system permanently.i.e
store the Java Object state into Relational model i.e in
database product.

Is This Answer Correct ?    0 Yes 1 No

what is jdbc?..

Answer / nivas

java database connection or connectivety

Is This Answer Correct ?    0 Yes 1 No

what is jdbc?..

Answer / rohil

JDBC IS JAVA DATABASE CONNECTIVITY

this is used to get our java code connected with database
so that everytime we execute our code we dont have to start
from beginnning ...ie again making objects and giving
values again...with databse connectivty u can store the
data once and for all...

package com.mypack;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import oracle.jdbc.driver.*;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet Class
*
* @web.servlet name="CDataAccess"
* display-name="Name for
CDataAccess"
* description="Description for
CDataAccess"
* @web.servlet-mapping url-pattern="/CDataAccess"
* @web.servlet-init-param name="A parameter"
* value="A value"
*/
public class CDataAccess extends HttpServlet {
Connection con=null;
Statement st=null;
PrintWriter out=null;
ResultSet rs=null;
public CDataAccess() {
super();
// TODO Auto-generated constructor stub
}

protected void doGet(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException,
IOException {
// TODO Auto-generated method stub
//super.doGet(req, resp);
out=resp.getWriter();
String prodId=(String)req.getParameter
("txtProdId");
String prodName=(String)req.getParameter
("txtProdName");

try
{
//register the driver with the
application
DriverManager.registerDriver(new
oracle.jdbc.OracleDriver());
//connecting with the database
con=DriverManager.getConnection
("jdbc:oracle:thin:databse name:1521:javadb","name of
server","password");
//Connection c=getCon();
if(!con.isClosed() )
{
out.println("Connection
established");

st=con.createStatement();//creates
an object of statement
String query="insert into Products
values('"+prodId+"','"+prodName+"')";

int i=st.executeUpdate(query);
if(i>0)
{
out.println("Data
inserted"+"<br/>");
}
String q="select * from Products";
rs=st.executeQuery(q);
while(rs.next())
{
out.println(rs.getString
("PID")+","+rs.getString("PNAME")+"<br/>");

}
st.close();


}
}
catch(SQLException ex){

out.println(ex.getMessage());
}




}

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Java Related AllOther Interview Questions

I am new to jsf rich faces. I am using rich faces datatable rich:datatable. On entering the value, values get filtered in table. Now how can i get the value i selected in backing bean?

1 Answers   Hexaware, IBM,


What is meant by code profiling?

0 Answers  


Explain different way of using thread?

0 Answers  


1.can i use super keyword in normal class(not inheritance) to call any method?if so how can i call particular variable? 2.In the inheritance how can i access the particular variable from the base class(it containing 5 variables) using super keyword?

0 Answers  


What gives java it’s “write once and run anywhere” nature?

1 Answers  


How do you create a jar file?

0 Answers  


What is javax annotation generated?

0 Answers  


Input :14000 Output : hundred and fourteen thousand.(wrong) Desired output : fourteen hundred thousand.

2 Answers   Sapient,


please suggest me final year project ideas for computer engg.on java as soon as possible becaus eo want to sumbit project name. and i am very confused.

1 Answers  


What is flatmap in java8?

0 Answers  


What is ehcache in java?

0 Answers  


When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?

0 Answers  


Categories