Forums Register Login

Connection through DSN

+Pie Number of slices to send: Send
Although I have got two methods of JDBC connection (thin and oci8) but can't try it now and don't want to take any risk, so asking for one more method.

Through DNS:
-----------

When we create DSN, we have to give value for four items:

1] DSN Name = dsn1
2] DSN Description = dsn2
3] Service Name = dsn3
4] User Name = dsn4

Suppose I have given values as per I wrote above, then what would be the code for DB connection:



Please help me in Driver Name and URL. And if any JAR or ZIP file, we have to take in classpath, then please tell me the name of that.

Thanks a lot.


[ November 17, 2005: Message edited by: rathi ji ]
[ November 17, 2005: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
Hi,

You can put it like this

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc dbc SN","username","password");
Ststement stmt = con.createStatement();

<for win2000pro>
DSN is the name that you made in programs->settings->control panel->Administrative tools->Data Sources(ODBC)
+Pie Number of slices to send: Send
Will it be like this:



No need for DSN description, Service name and User name?, can I give any thing in these fields?

Please reply.

Thanks a lot.
[ November 17, 2005: Message edited by: rathi ji ]
+Pie Number of slices to send: Send
"VJS",
we take the rule on display names quite seriously.

Your display name was originally valid, now it is not. Please change it back immediately, since accounts with invalid display names get deleted. Often without warning.

thanks,
Dave.
+Pie Number of slices to send: Send
hi
Yes it is like that :---

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:DSN","username","password");
+Pie Number of slices to send: Send
Thanks a lot Vikramjit.

And here 'DSN' is DSN Name, that is dsn1 in my case.
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 881 times.
Similar Threads
how can I know my database name?
wizards using jsp
Hibernate with TeraData using DSN
Can anyone please help Multi span JTable header
how about joining a start-up leaving a job in big company...
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:16:12.