how to make a connection url string using DSN

Recommended Answers

All 4 Replies

Google my friend is what you should do, like this

but what the heck does this have to do with JSP?
DSN is an ODBC concept, and has no relation to Java whatsoever.
It's also an utterly outdated concept for for example .NET.

how to make a connection url string using DSN

You can use these two lines for connection using DSN

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:dsn");

here i am using type 1 driver for connectivity.

This sample code connects from DB2 to WSAD .

<URL REMOVED>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.