473,419 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

how to connect jsp page with the db2 database?

Expand|Select|Wrap|Line Numbers
  1. @ page pageEncoding="UTF-8" %>
  2. <%@page contentType="text/html" %>
  3. <%@page session="false" %>
  4. <%@page import="java.sql.*" %>
  5. <%@page import="java.util.*" %>
  6. <html>
  7.     <head>
  8.         <title>emplolyees firstname</title>
  9.     </head>
  10.     <body>
  11.         <%
  12.          Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
  13.          Connection con=DriverManager.getConnection("jdbc:db2:sample","","");
  14.          String sql="SELECT firstnme from emp ";
  15.          Statement st=con.createStatement();
  16.          ResultSet rs= st.executeQuery(sql);
  17.          while(rs.next())
  18.           {
  19.              String firstname=rs.getString(1);
  20.        %>
  21.            <h5>
  22.               EMPLOYEES FIRSTNAME ARE :<%= firstname%>
  23.            </h5>
  24.            <br>
  25.        <%
  26.         }
  27.         rs.close();
  28.         rs=null;
  29.         st.close();
  30.         st=null;
  31.         con.close();
  32.  
  33.  
  34.       %>
  35.       <br>
  36.       <br>
  37.       <b> THE END OF DATA</b>
  38.     </body>
  39. </html>
  40.  
i did dis but the result is not coming wat is d problem..
error report is :
description:-The requested resource () is not available.
Aug 16 '10 #1
0 1704

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Alex Hardin | last post by:
Hey, I'm trying to use the connect to database wizard to connect to a MySQL database on my web server, 66.235.193.45 (I'm actually not sure if that points specifically to my part of the server, if...
1
by: John Bailo | last post by:
I just loaded c# express and sql05 express. When I try to connect to the database from c#e nothing happens. I tried "connect to database" and when I click on the menu, it just goes away and...
3
by: mbsparrow | last post by:
I have just installed sql server 2005 Express . The Server is running but I can't connect to the Server in Server Management Studio (on the same machine). I am getting the following message: ...
1
by: =?Utf-8?B?TmVsc29uIEFuZHLDqQ==?= | last post by:
Dear friends, I'm a Web Services newbie and I have created a simple Web Service that given 3 parameters accesses a database and returns 1 value. When run from Visual Studio 2005, the Webservice...
0
by: manevolution | last post by:
I've used php mambo and oracle 9 to develop a web-based application..I also used separate server for database and the system..but sometime an error occur to the database connection, its display...
0
by: asad56 | last post by:
I am workin with a superstore managment project. I connect Access database with main form . Then it work properly. But now I connect same database with another table or field in another form which is...
4
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
This is kind of a cross forum problem. I am trying to Connect to database by clicking on: Tools Connect To Database Select: Microsoft SQL Server (SqlClient). However, there are no server listed...
0
by: binitarana | last post by:
I have a problem with .net application. We have an application created in VB.Net. It's a client server application. The database is SQL Server 2000. 5-6 clinet machine are accessing the server....
0
by: Wendi Turner | last post by:
ASP.NET 2.0 C# WebService Connect to Database: Sql Server 2005 --------------------------------------------------------------------------------------------------- I have successfully created a...
2
by: Wendi Turner | last post by:
ASP.NET 2.0 C# WebService Connect to Database: Sql Server 2005 --------------------------------------------------------------------------------------------------- I have successfully created a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.