DB connection
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dave_wong
Posted On:   Friday, April 20, 2001 08:20 PM

Hi there, I have a question on connecting oracle with my jsp. my testing code is : <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %> <% java.sql.Connection db = java.sql.DriverManager.getConnection ("jdbc:odbc:@kst","scott","tiger"); %> where kst = database, scott=username, tiger=password And I got the following message: javax.servlet.ServletException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I am sure that kst is one of data sources in the ODBC data source found in Windows 98 (since my testing envir is win98). And also, what is the different of Class.for   More>>

Hi there,
I have a question on connecting oracle with my jsp.
my testing code is :
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<% java.sql.Connection db =
java.sql.DriverManager.getConnection ("jdbc:odbc:@kst","scott","tiger"); %>
where kst = database, scott=username, tiger=password

And I got the following message:

javax.servlet.ServletException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I am sure that kst is one of data sources in the ODBC data source found in Windows 98 (since my testing envir is win98).

And also, what is the different of
Class.forName( xxx); and
DriverManager.registerDriver( xxx );
I've seen some doc telling to use one and the others tell me to you the other one.

thanks
dave

   <<Less
About | Sitemap | Contact