GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  JDBC
Go To First  |  Previous Question  |  Next Question 
 JDBC  |  Question 125 of 135    Print  
JDBC Type1 drivers
Can we use Type1 driver in web Application?

If possible give me a simple example for all driver types?



  
Total Answers and Comments: 9 Last Update: July 15, 2008     Asked by: jagadesh05 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 11, 2008 06:31:43   #1  
sampra Member Since: February 2008   Contribution: 279    

RE: JDBC Type1 drivers
Yes we can use Type 1 driver for web application but here need to load lot of DB libaray
 
Is this answer useful? Yes | No
February 11, 2008 06:39:14   #2  
sampra Member Since: February 2008   Contribution: 279    

RE: JDBC Type1 drivers
if u want example then mail me  
 
Is this answer useful? Yes | No
February 13, 2008 06:23:49   #3  
gottiparthy Member Since: February 2008   Contribution: 1    

RE: JDBC Type1 drivers
I want one Example with JDBC  Type1 drivers
 
Is this answer useful? Yes | No
February 13, 2008 23:31:14   #4  
sampra Member Since: February 2008   Contribution: 279    

RE: JDBC Type1 drivers
can u gv me ur mail id
 
Is this answer useful? Yes | No
February 13, 2008 23:32:35   #5  
sampra Member Since: February 2008   Contribution: 279    

RE: JDBC Type1 drivers

Java Test


/*create table student

(

sid number(5),

sname char(15),

email char(15),

phone number(12)

); */

import java.sql.*;

class Test

{

public static void main(String as[])

{

try{

int sid=Integer.parseInt(as[0]);

String sname=as[1];

String email=as[2];

long phone=Long.parseLong(as[3]);

//step 1-load the class

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

//step 2-establish the connection

Connection con=DriverManager.getConnection("jdbc:odbc:studentDSN","scott","tiger");

//step 3 create the statment

Statement st=con.createStatement();

//step 4 prepare sql queary and execute

String sql="insert into student values("+sid+",'"+sname+"','"+email+"',"+phone+")";

int x=st.executeUpdate(sql);

//step 5..process result

if(x==1)

{

System.out.println("Inserted...");

}

else

{


System.out.println("Not.Inserted");

}

//step 6-clean up

st.close();

con.close();

}catch(Exception e)

{

e.printStackTrace();

}


}

}


 
Is this answer useful? Yes | No
February 13, 2008 23:36:49   #6  
sampra Member Since: February 2008   Contribution: 279    

RE: JDBC Type1 drivers
i can not post whole code bcz geek person wont allow it better gv ur mail id
 
Is this answer useful? Yes | No
February 13, 2008 23:42:46   #7  
sampra Member Since: February 2008   Contribution: 279    

RE: JDBC Type1 drivers
samsampra at gmail my mail id

 
Is this answer useful? Yes | No
July 14, 2008 03:41:36   #8  
timmireddy Member Since: May 2008   Contribution: 11    

RE: JDBC Type1 drivers
There are four types of JDBC drivers, Type1 driver is not purely java driver, here we can uploaded so many databse libraries ( these are the middleware softwares).So better to use type-4 driver (also called Oracle thin driver )
 
Is this answer useful? Yes | No
July 15, 2008 02:52:14   #9  
timmireddy Member Since: May 2008   Contribution: 11    

RE: JDBC Type1 drivers
Yes , u can use JDBC type-1 driver for web application but here need to upload many Database libraries for middleware interaction purpose.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape