<div id="about">
<img src="/js/images/cont.png" alt="" />
</div>
<div class="con">
<h5>JS-Soft Technologies</h5>
<div class="con1">
<p>20-74 NGO Colony</p>
<p>Main Road</p>
<p>Nagercoil</p>
<p>Kanyakumari-2<br><br>
<p>+919629455197</p>
<p>+919566262912</p>
</div><!--close con1-->
</div><!--close con-->
<div id="menubar">
<ul id="nav">
<li><a href="/js/index.jsp">Home</a></li>
<li><a href="/js/pages/about.jsp">About</a></li>
<li><a class="hsubs" href="#">Services</a>
<ul class="subs">
<li><a href="/js/pages/application.jsp">Application Services</a></li>
<li><a href="/js/pages/web.jsp">Web Services </a></li>
<li><a href="/js/pages/testing.jsp">Testin Services</a></li>
<li><a href="/js/pages/remote.jsp">Remote Tech Support </a></li>
<li><a href="#">SEO</a></li>
</ul>
</li>
<li><a href="/js/pages/career.jsp">Career</a></li>
<li><a href="/js/pages/conacts.jsp">Conact Us</a></li>
</ul>
</div><!--close menubar-->
<div id="cont">
<h4>Conact Us</h4><br>
<div>
<form action="http://localhost:8080/js/pages/conacts.jsp" method="post">
<table class="contact">
<tr><td align="right">*Select Inquiry Type:</td>
<td width="30%"><select name="selectinq" class="inputForm">
<option value="-1">Select Inquiry Type</option>
<option value="Career">Career Seekers</option>
<option value="investor">Investor Relations</option>
<option value="media">Media</option>
<option value="media">Request for Services</option>
</select>
</td></tr>
<TR>
<td align="right">First Name</td>
<TD width="30%"><INPUT TYPE="text" NAME="fname" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Last Name</td>
<TD width="30%"><INPUT TYPE="text" NAME="lname" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Organization</td>
<TD width="30%"><INPUT TYPE="text" NAME="organization" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Email</td>
<TD width="30%"><INPUT TYPE="text" NAME="email" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Phone Number</td>
<TD width="30%"><INPUT TYPE="text" NAME="phone" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Address</td>
<TD width="30%"><INPUT TYPE="text" NAME="address" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">City</td>
<TD width="30%"><INPUT TYPE="text" NAME="city" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Country</td>
<TD width="30%"><INPUT TYPE="text" NAME="country" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Zip</td>
<TD width="50%"><INPUT TYPE="text" NAME="zip" size="26%" class="inputForm"></TD>
</tr>
<TR>
<td align="right">Message</td>
<td><textarea rows="10" cols="30" name="message" class="inputForm"></textarea></TD>
</tr>
<TR>
<td></td>
<TD width="50%"><INPUT TYPE="submit" VALUE="submit" class="inputForm"></TD>
</tr>
</table>
<%
String selectinq = request.getParameter("selectinq");
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String organization=request.getParameter("organization");
String email=request.getParameter("email");
String phone=request.getParameter("phone");
String address=request.getParameter("address");
String city = request.getParameter("city");
String country=request.getParameter("country");
String zip = request.getParameter("zip");
String message=request.getParameter("message");
/* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */ String connectionURL = "jdbc:mysql://localhost:3306/js";
// declare a connection by using Connection interface
Connection connection = null;
// declare object of Statement interface that uses for executing sql statements.
PreparedStatement pstatement = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
int updateQuery = 0;
// check if the text box is empty
if(selectinq!=null && fname!=null && lname!=null && organization!=null && email!=null && phone!=null && address!=null && city!=null && country!=null && zip!=null && message!=null)
{
// check if the text box having only blank spaces
if(selectinq!=" " && fname!=" " && lname!=" " && organization!=" " && email!=" " && phone!=" " && address!=" " && city!=" " && country!=" " && zip!=" " && message!=" ")
{
try {
/* Create a connection by using getConnection() method that takes
parameters of string type connection url, user name and password to connect
to database. */
connection = DriverManager.getConnection(connectionURL, "root", "root");
// sql query to insert values in the secified table.
String queryString = "INSERT INTO inquri(selectinq,,fname,lname,organization,email,phone,address,city,country,zip,message) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
pstatement = connection.prepareStatement(queryString);
pstatement.setString(1, selectinq);
pstatement.setString(2, fname);
pstatement.setString(3, lname);
pstatement.setString(4, organization);
pstatement.setString(5, email);
pstatement.setString(6, phone);
pstatement.setString(7, address);
pstatement.setString(8, city);
pstatement.setString(9, country);
pstatement.setString(10, zip);
pstatement.setString(11, message);
updateQuery = pstatement.executeUpdate();
if (updateQuery != 0) { %>
<br>
<TABLE style="background-color: #E3E4FA;" WIDTH="30%" border="1">
<tr><th>Data is inserted successfully in database.</th></tr>
</table>
<% } } catch (Exception ex) { out.println("Unable to connect to batabase.");
}
finally {
// close all the connections.
pstatement.close();
connection.close();
}
}
}
%>
</form>
</div>
</div>