This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Connect to access from jsp  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
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?
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Report post to moderator
cross-posted
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!