This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Connect to access from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Connect to access from jsp

Steven Riche
Greenhorn

Joined: Feb 10, 2004
Posts: 3
Hi all:
I am new to jsp and i met a problem while connecting to Microsoft Access.
The following is the code:
<%@ page import="java.sql.*" %>
<html>
<body>
<%
String name=request.getParameter("name");
String balance=null;
if(name==null || "".equals(name)){
name="";
balance="";
}
else{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
out.println("load driver");
Connection dbc=DriverManager.getConnection("jdbc dbc:kkk");
out.println("get connected");
Statement s=dbc.createStatement();
ResultSet rs=s.executeQuery("select balance from tt where name='"+name+"'");
if (rs.next()){
balance=rs.getString(1);
}
rs.close();
s.close();
dbc.close();
}catch(Exception ex){
out.println(ex.getMessage());
}
}

%>
<form method="Get">
Name <input type="text" name="name" value=<%= name %>>
Balance <input type="text" name="balance" value=<%= balance %>>
<input type="submit" name="submit">
<input type="reset" name="reset">
</form>
</body>
</html>

The error message is:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
the datasoure "kkk" is in the ODBC pool and it tests well when I run a standalone program.
Any ideas?
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
cross-posted
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Connect to access from jsp
 
Similar Threads
Servlet becomming slow
connect to Access from jsp
Servlet becomming slow
with out authentication it is forwading to another page
passing parameters from JSP to a Servlet