aspose file tools*
The moose likes JDBC and the fly likes what is dsn?user dsn?system dsn?file dsn? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "what is dsn?user dsn?system dsn?file dsn?" Watch "what is dsn?user dsn?system dsn?file dsn?" New topic
Author

what is dsn?user dsn?system dsn?file dsn?

Dinesh Jayaraj
Greenhorn

Joined: Nov 19, 2000
Posts: 23
hello friends
1> iam totaly confused with dsn?
what does it do?what is file dsn? system dsn? and user dsn?
why we should set them before connecting to db.
2>the method Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
will load the driver(jdbcdbc)actually from where it is
loaded wheather from jdk or windows os.
3>in jdbc url like jdbcdbc:xyz
wheather xyz is a dsn or a database name?
if it is dsn how it will resolve the
actual table name when we query the database.in the url we have to give userid
and password wheather theese userid and password corresponds to db or dsn?.
help please
dinesh

[This message has been edited by Thomas Paul (edited December 11, 2000).]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") will load the class JdbcOdbcDriver if it finds it on the classpath.
The dsn is one of two things:
1) It is the ODBC name of the database. That is, the name you defined when you set the database up in odbc.
jdbcdbc:OdbcName
2) The actual URL of the database, specifying the server ip address, the port number, and the database name.
jdbc:sybase://127.0.0.1:700/MyDataBase
Hope this clarifies things for you.
[This message has been edited by Thomas Paul (edited December 11, 2000).]


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Matthew Roth
Greenhorn

Joined: Jan 30, 2001
Posts: 19
How can you access a database without using an dsn? I want to tell it to find the database in the same folder as where the program resides.
thanks for your help
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: what is dsn?user dsn?system dsn?file dsn?