Sonu Philip

Greenhorn
+ Follow
since Jun 15, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sonu Philip

Hello Ranchers..
Here i'm doing a project in JSP and oracle. For that i want to display the client code in a combo box(select tag) and when ever i select that combo and change the value.. the clients address, phone number everything has to display in the text-fields given below.

Displaying the codes in the combo box is completed and it is working perfectly.. So what should i do to display the other values corresponding to the client_code in the below text-fields..

the code i've done is like this

-------------------------------------------------------------------------
<td><select size="1" name="shipper_code">
<option value="none" selected>--Select One--</option>
<%Statement stmt = dbCon.createStatement();
String query = "Select buyerclientcode from seaimp.buyerclient order by buyerclientcode";
ResultSet rs = stmt.executeQuery(query);
while(rs.next())
{String code = rs.getString(1);
%>
<option value="<%=code%>"><%= code%></option>
<%
}
stmt.close();
//rs.close();
%>
</select></td>
---------------------------------------------------------------------------

It is displaying all the records in the table.. but i want to display the
address of the particular client when the user changes the client code

For that what should i do...
Please help me ranchers...
Thanks in advance

regards
Aravind
Hello Ranchers.,
I'm doing a program in JSP and oracle and Apache Tomcat as the webserver. I'm doing this as my academic project in Cochin Shipyard.
Here for file opening.. i want to specify some fields!!
when i tried to run this page the webserver is going shut down..
i thought it was the problem with Tomcat and i changed to Sun's App Server
this also happened in Sun's Appserver

when ever i load this page.. this is happening..
i'm placing the code here.. please make a look thru this and tell me what the problem is

<%@ page language="java" session="true" import="java.sql.*" import="java.lang.*" %>
<%
String firstname = (String)session.getValue("firstname");
String lastname = (String)session.getValue("lastname");
Integer admin = (Integer)session.getValue("admin");
Integer status = (Integer)session.getValue("status");
String id = (String)session.getValue("id");

if(firstname==null || status==null || lastname==null || admin==null)
{
response.sendRedirect("../../../sessionout.htm");}
%>
<script language="javascript" type="text/javascript" src="../scripts/jscript.js">
</script>

<html xmlns:astutemedia>
<head>
<?import namespace="astutemedia" implementation="CalendarPopup.htc">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>New Page 1</title>
</head>
<LINK href="../../../css/stylesheet.css" type=text/css rel=stylesheet>

<body>
<%
try
{
try
{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{out.println(e);
}

String dbURL = "jdbc:odbc:Operations";

Connection dbCon;
dbCon = DriverManager.getConnection(dbURL,"ict","ict");
Statement stmt = dbCon.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
String query1 = "Select masterfileno from seaimp.importfile order by masterfileno";
ResultSet rs = stmt.executeQuery(query1);
String fileno="";
rs.last();
fileno = rs.getString(1);
String last_values = fileno.substring(3,8);
int file_no = Integer.parseInt(last_values);
file_no = file_no + 1;
String new_file_no = String.valueOf(file_no);
String filno="";
if(file_no<=9999)
filno = "10.0" + new_file_no;
if(file_no>=10000 && file_no <= 99999)
filno = "10." + new_file_no;

%>
<form name="form1" onsubmit="validate();return false">
<table border="0" width="100%" id="table1">
<tr>
<td width="334" colspan="2">

<p><font color="#0052BA" size="2"><b>10 Series File Opening</b></font></p>
</td>
<td width="171"> </td>
<td width="463"><span style="font-size: 9pt; font-weight: 700">Fields
marked with </span><font size="4" color="#FF0000">
<span style="font-weight: 700">*</span></font><span style="font-size: 9pt; font-weight: 700">
are mandatory</span></td>
</tr>
<tr>
<td width="131"> </td>
<td width="203"> </td>
<td width="171"> </td>
<td width="463"> </td>
</tr>
<tr>
<td width="131"><b><font style="font-size: 9pt" face="Arial">File Number</font></b></td>
<td width="203"> <font color ="#005900" style="font-size: 9pt; font-weight: 700"><%=filno%></font></td>
<%
stmt.close();
%>
<td width="171"><b><font face="Arial" style="font-size: 9pt">TBL Number</font></b></td>
<td width="463"><font face="Arial" size="1">
<span style="font-size: 9pt"><input name="tbl" size="20"></span></font></td>
</tr>
<tr>
<td width="131"><b><font face="Arial" style="font-size: 9pt">Date</font></b></td>
<td width="203"><font face="Arial" size="1">
<span style="font-size: 9pt"><input name="date" size="20" readonly></span></font></td>
<td width="171"><b><font face="Arial" style="font-size: 9pt">CIF</font></b></td>
<td width="463"><font face="Arial" size="1">
<span style="font-size: 9pt"><input name="cif" size="20"></span></font></td>
</tr>
<tr>
<td width="131"><b><font face="Arial" style="font-size: 9pt">Office</font></b><font size="4" color="#FF0000"><span style="font-weight: 700">*</span></font></td>
<td width="203"><font face="Arial" size="1">
<span style="font-size: 9pt"><select size="1" name="office">
<option value="none" selected>--Select one--</option>
<%
String query2 = "Select * from seaimp.offices order by officename";
Statement stmt1 = dbCon.createStatement();
ResultSet rs1 = stmt1.executeQuery(query2);
while(rs1.next())
{String office_code = rs1.getString(1);
String office_name = rs1.getString(2);
%>
<option value="<%=office_code%>"><%=office_name%></option>
<%}
rs1.close();
stmt1.close();
%>
</select></span></font></td>
<td width="171"><b><font face="Arial" style="font-size: 9pt">Message Ref</font></b></td>
<td><font face="Arial" size="1"><span style="font-size: 9pt">
<input name="msgref" size="20"></span></font></td>
</tr>
<tr>
<td width="131"><b><font face="Arial" style="font-size: 9pt">File Type</font></b><font size="4" color="#FF0000"><span style="font-weight: 700">*</span></font></td>
<td width="203"><font face="Arial" size="1">
<span style="font-size: 9pt"><select size="1" name="filetype">
<option selected value="none">--Select One--</option>
<%
String query3 = "Select * from seaimp.filetype order by filetype";
Statement stmt2 = dbCon.createStatement();
ResultSet rs2 = stmt2.executeQuery(query3);
while(rs2.next())
{String file_type = rs2.getString(1);
String file_desc = rs2.getString(2);
%>
<option value="<%=file_type%>"><%=file_desc%></option>
<%}
rs2.close();
stmt2.close();
%>


</select></span></font></td>
<td width="171"><b><font face="Arial" style="font-size: 9pt">Message
Date</font></b></td>
<td>
<font face="Arial" size="1"><span style="font-size: 9pt">
<input class="FormTextBox" id="Date1" maxlength="10" name="Date1" size="20" readonly></span></font><font face="Arial" style="font-size: 9pt"><b>
</b></font>
<astutemedia:calendar id="Calendar1" target="Date1"></astutemedia:calendar></td>
</tr>
<tr>
<td width="131"><b><font face="Arial" style="font-size: 9pt">Principal</font></b><font size="4" color="#FF0000"><span style="font-weight: 700">*</span></font></td>
<td width="203"><select size="1" name="principal">
<option selected value="none">--Select One--</option>
<%
String query4 = "Select * from seaimp.principal order by principalcode";
Statement stmt3 = dbCon.createStatement();
ResultSet rs3 = stmt3.executeQuery(query4);
while(rs3.next())
{String p_code = rs3.getString(1);
String p_name = rs3.getString(2);
%>
<option value="<%=p_code%>"><%=p_name%></option>
<%}
rs3.close();
stmt3.close();
%>
</select></td>
<td width="171"><b><font face="Arial" style="font-size: 9pt">Mombasa Ref</font></b></td>
<td><font face="Arial" size="1"><span style="font-size: 9pt">
<input name="mombassa" size="20"></span></font></td>
</tr>
<tr>
<td width="131"><b><font face="Arial" style="font-size: 9pt">Principal
Ref</font></b></td>
<td width="203"><font face="Arial" size="1">
<span style="font-size: 9pt"><input name="pref" size="20"></span></font></td>
<td width="171"><b><font face="Arial" style="font-size: 9pt">Other
Reference</font></b></td>
<td><font face="Arial" size="1"><span style="font-size: 9pt">
<input name="other" size="20"></span></font></td>
</tr>
<tr>
<td width="131"> </td>
<td width="203"> </td>
<td width="638" colspan="2">
 </td>
</tr>
<tr>
<td width="131"> </td>
<td width="378" colspan="2">
<p align="center">
<input type="submit" value="Add New" name="B1"></td>
<td width="463">
 </td>
</tr>
<tr>
<td width="131"> </td>
<td width="203"> </td>
<td width="638" colspan="2">
 </td>
</tr>
</table>
</form>
<%
dbCon.close();
}
catch(SQLException e)
{out.println(e);
}
%>

</body>
</html>


u can copy this code and see the layout..
please help me ranchers..

my team is telling the server is over loaded.. that is the problem..
and i don't think so..

please help me.. ranchers..

thanks in advance
regards
Sonu
[ June 19, 2006: Message edited by: Bear Bibeault ]
Thank you Sanny and Balu!!
Thanks a lot for sending me the code itself.. Sanny's code is too large. So better i change to Balu's code.
Balu one doubt in that program you have used a package there.
1)What is the content of the package. and another doubt is it storing in the folder which u have specified there..
2)At the time of uploadig is that possible to store the filename and also the path of the file in the server in the oracle database.
3)When i try to retrieve the profile.. can i see the details of the particular person with his image...!!

Please reply ..
Once again thanks..

regards
Sonu
18 years ago
JSP
Thank you Bear Bibeault.,
Since i'm a beginner in JSP i couldn't understand much about that. So kindly please reply with some urls of file uploading for beginners or some tutorials or some examples also..

Thanks in advance
regards
Sonu!!
18 years ago
JSP
Hello Friends.,
This is my first post in this group. Hope you all will help me.
I'm doing project in JSP and Oracle and the webserver i'm using for testing is Apache Tomcat and Sun's AppServer.
Here in my project my module is Human Resource System. So for that i want to store the employee details. with their pictures.
I don't know how to upload the image file to the server so that i can create a folder named "images" inside my application and can store all the image files inside that..for example.. if there is 100 employees means. i want to upload all the 100 photos and also their details.
so for that i want to store the path and file name of the image file in the database also..

Any way...
Please help me friends.
Give me some ideas to do this and make my project successful

Thanks
regards
Sonu
18 years ago
JSP