473,387 Members | 3,787 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,387 software developers and data experts.

jsp connectivity

i have a problem in below code it is not confirm the rno from rvehicles table eventhough the rno number exist in the table, it goes directly to "wrong registration number retype".

<html><Title>StolenVehicleInvestigationSystem</title>
<body>
<%@ page import = "java.sql.*" %>
<%! Connection con; Statement st; ResultSet rs,rs1; %>
<%
try{
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
con=DriverManager.getConnection("jdbc:oracle:thin: @127.0.0.1:1521:xe","system","tiger");
String cmd = "select vno,email from rvehicles where rno='"+ request.getParameter("rno") +"'";
st=con.createStatement();
rs=st.executeQuery(cmd);
if(!rs.next())
{%>
<h2> Wrong Registraton Number. Retype <h2>
<%@ include file="stolen.html" %>
<%
} else
{
String myvno = rs.getString(1);
String mymail = rs.getString(2);
String[] mon={"JAN","FEB","MAR","APR","MAY","JUN","JUL","AU G","SEP","OCT","NOV","DEC" };
String monval=mon[Integer.parseInt(request.getParameter("month"))-1];

String dst = "'"+request.getParameter("day")
+"-"+monval+
"-"+request.getParameter("year")+"'";


cmd = "insert into stolenlist values("+request.getParameter("rno")+",'"
+myvno+"',"+dst+")";
st.execute(cmd);
%>
<font size=5 color=red>
Your vehicle registered in 'stolen vehicles' database. When information about it is available we will inform you to the following email address <br><Center><u> <%= mymail %> </center></u>
You can also check the whereabouts from <a href="trace.html"> here</a><hr>
<%@ include file="home1.html" %>
<%
}
}catch(Exception e)
{
e.printStackTrace();
out.println(e);
}
%>
</html>
Dec 28 '14 #1
1 1354
weaknessforcats
9,208 Expert Mod 8TB
What language is this, exactly?
Dec 28 '14 #2

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

Similar topics

3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
2
by: Axel Dachtler | last post by:
I am looking for detailed information about the topic "connectivity" in Oracle 9i including JDBC and CGI. Thank you
1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
2
by: pengfrank | last post by:
I have a 500-MB full installation CD for SQL Server 2000. All I need is to install "Client Connectivity" component (about 272K) on a bunch of workstations for users across the nation. How do I...
3
by: Omegamon | last post by:
This one should be an easy one for the community. What sort of PC client software do I need for connectivity to a DB2 database? It appears DB2 Connect is special for PC/Unix Connectivity to...
3
by: junaid | last post by:
Hi to all, Can it is possible to connect to the databse like postgre or mysql through a C programm? I know the basics of C and I have developed a small program which uses a file for the...
3
by: Niks | last post by:
Hi, I need to connect to SQL server Database using a System DSN. Can anyone tell me how to connect to SQL Server using DSN in ASP.NET (VB.Net). Using a Try Catch block. Does anyone know how to...
1
by: Darren McDowell via .NET 247 | last post by:
I have a situation, I was wondering if someone could help me. Wehave a .net web service, it runs several transactions in sqlserver 2000. We have several clients which connect to this webservice in...
1
by: lovkeshanand | last post by:
Dear All, I am using the oracle transparent gateway connectivity with sql server using tg4msql,as far as settings are concerned those were set and Connectivity is working Fine, and getting the...
1
by: prajakta272 | last post by:
Hello! I want to know basic connectivity sql using oracle and apache tomcat in NetBeans.I know connectivity of Oracle with GlassFish server.But I don't know Oracle connectivity with apache...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.