CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 JSP connectivity to oracle 10g

Print topic Send  topic

Author Message
misha_88

Posts: 1
Posted: 02/27/2012, 9:31 PM

I hav written the following code for insertion.But no row is being inserted.I m nt geeting any error msg/exception.


<%@ page import="java.sql.Connection"%>
<%@ page import="java.sql.DriverManager"%>
<%@ page import="java.sql.ResultSet"%>
<%@ page import="java.sql.Statement"%>
<%@ page import="java.sql.SQLException"%>

<html>
<head>
<title>Registration</title>
<h1 align=center>Registration</h1>


</html>
<%

java.sql.Connection con=null;
java.sql.Statement stmt=null;
java.sql.ResultSet rs=null;


String fname=request.getParameter("t1");
String lname=request.getParameter("t2");
try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:amrapali","system","amrapali88");
stmt=con.createStatement();
rs = stmt.executeQuery("Insert into regdb values(fname,lname)");

out.println("Connected");
}
catch(ClassNotFoundException e)
{
System.out.print("classNotFound Exeception caught:"+e);
}
catch(SQLException e)
{
System.out.println("SQLEXception :"+e);
}
%>


<script>
function validate()
{
var a1=document.f1.t1.value;
var a2=document.f1.t2.value;


if(a1=="")
{
alert("Enter the username.");
return false;

}

else
{

if(a2=="")
{
alert("Enter the Password.");
return false;
}
}
}
</script>
</head>
<center>
<body>
<form name='f1' method='post'

action='firsttest.jsp'onsubmit="return validate()">


Enter First name:<input type="text" name="t1"><Br>
Enter Last name:<input type="text" name="t2"><Br>


Enter Email ID:<input type="text" value=""><Br>
Enter Password:<input type="text" value=""><Br>
Confirm Password:<input type="text" value=""><Br>
Gender:<input type="radio" name="option"> Female
<br>
<input type="submit" value="submit">
</form>
<form method='post' action='firsttest.jsp'>
<input type="submit" value="Cancel">
</form>
</body>
</center>
</html>
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.