Yes we can use Type 1 driver for web application but here need to load lot of DB libaray
Login to rate this answer.
if u want example then mail me
Login to rate this answer.
I want one Example with JDBC Type1 drivers
Login to rate this answer.
can u gv me ur mail id
Login to rate this answer.
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();
}
}
}
Login to rate this answer.
i can not post whole code bcz geek person wont allow it better gv ur mail id
Login to rate this answer.
samsampra at gmail my mail id
Login to rate this answer.
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 )
Login to rate this answer.
Yes , u can use JDBC type-1 driver for web application but here need to upload many Database libraries for middleware interaction purpose.
Login to rate this answer.