Home » Developer & Programmer » JDeveloper, Java & XML » JAVA connection to DATABASED
JAVA connection to DATABASED [message #554054] Thu, 10 May 2012 02:54
Messages: 237
Registered: July 2005
Location: Karachi
Senior Member

Dear Experts

see code the below and tell me what is this wrapper class do ? and how can i make connection class without use of wrapper. I just want to make class for making connection for database by passing parameters, parameter may not bound with any specific database it could be sqlserver, oracle or access. Would you please help me to make that kind of class?



//import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Wrapper;

public class DoConnect {

public Wrapper DoConnect(String drv, String url, String uid, String pss){
try {
System.out.println("Driver class found");
} catch (ClassNotFoundException err) {
try {
return DriverManager.getConnection(url, uid, pss);
} catch (SQLException err) {
return null;
public static void main(String[] args) {
DoConnect ocon= new DoConnect();
ocon.DoConnect("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@", "scott", "tiger");

Previous Topic: XML Validation (merged 4)
Next Topic: teamwork
Goto Forum:

Current Time: Sat Sep 25 18:33:10 CDT 2021