Hai,
You can use system dsn,so that any user of the system can use it.Else,create file dsn and you are not needed to create every time,just set the location of the file dsn.
Dsn file basically contains the location of the driver name,location,datasource name,username etc.
If you do not want dsn to be used,go for type 2 or type 4 Driver.There will be no need to craete dsn.
Here is the sample for them
Type 2 - The Oracle OCI
JDBC driver requires an installation of Oracle's SQL*Net to provide communication to the database server.
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc : oracle : oci8 : @hostname : Databasename", "scott", "tiger");
Type 4 - 100%
Java Driver
mainly used for webappl.Fast access.Nothing is needed preinstalled.
Oracle provides thin driver for this.
Driver driver = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
DriverManager.registerDriver(driver);
conn = DriverManager.getConnection("jdbc : oracle : thin : @127.0.0.1:1521
bname", "scott", "tiger")
[ August 05, 2004: Message edited by: Mohd Afroz Ahmed ]