aspose file tools*
The moose likes JDBC and the fly likes Query about DSN and DSN less Connection?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Query about DSN and DSN less Connection??" Watch "Query about DSN and DSN less Connection??" New topic
Author

Query about DSN and DSN less Connection??

Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi all friends,
I am confused about DSN connection and DSN less connection concept. Can any one plz tell me In what situation I should use DSN connection and In what situation I should use DSN less connection and what are advantages and Disadvantges one over other and vice versa Or give me some links so that I can take guide from there.
Regards
Bikash
Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
I am not sure what you mean by DSN less connection.
Basically I think its the driver types that the issue is about.
One of the methods used to connect to database would be a Bridge connection (JDBC-ODBC). Here you would be using a DSN name. You can also use native drivers provided by the database vendor like oci driver of oracle. There can also be pure native drivers. In this case as is Oracle Thin Driver, we communicate directly to the database process. Either way the connection string used in each case may be called as a Data Source.
Prash
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi Prashanth,
I mean DSN less connection when we connect database through driver and using driver,user,password,Data Source and DSN connection means when we connect database through bridge connection(JDBC-ODBC)then we use DSN,user,password.I want to know that Is there any advantages and disadvantages one over other or both connections are same.
Regards
Bikash
Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
Originally posted by Bikash Paul:
Hi Prashanth,
I mean DSN less connection when we connect database through driver and using driver,user,password,Data Source and DSN connection means when we connect database through bridge connection(JDBC-ODBC)then we use DSN,user,password.I want to know that Is there any advantages and disadvantages one over other or both connections are same.
Regards
Bikash

The driver is always required to communicate to the database. The only quetion is what kind of driver. Yes native drivers are faster than the bridge.
Further if it is thin driver it directly communicates with the DB listener.
Example
Connection conn =
DriverManager.getConnection ("jdbc racle:thin:@machine:1521 bmsname",
"scott", "tiger");
As you can see we directly give the port number and ip address.
But there are some features (in oracle it might not support heavy transactions)
regards
Prash
 
wood burning stoves
 
subject: Query about DSN and DSN less Connection??