Megha Rajeevan

Greenhorn
+ Follow
since Mar 22, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Megha Rajeevan

Hello ranchers.,
I'm using JSP and oracle for doing a project.,
now when i create an user i want to insert all the details of the user in to the database and then after inserting the values the jsp page will automatically redirect to another page calling send_mail.jsp
here in this page it will get the username and other details from the url and the send a mail to the administrator@mydomain.com abt the new user joined..

now i don't know how to write the code in this page.

can any one please help me about doing this.. please
how to write the code for sending the mails..

please ranchers..

thanks in advance.

regareds
Megha
17 years ago
Hello Ranchers.
I'm doing a project in JSP and oracle.. In a particular module i've send an email regarding the fault management..
The code i've done is here
---------------------------------------------------------------------------

<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1" prefix="mt" %>
<%@ page session="false" %>
<head>
<title>Example JSP using mailer taglib</title>
</head>
<body bgcolor="#FFFFFF">
<!-- The server, session, or mimeMessage attributes are not required -->
<!-- the mail server used will be localhost. -->
<mt:mail to="meg.rajeev@gmail.com" from="meg.rajeev@test.com" subject="test">
<mt:message>Hi---------this is a test email</mt:message>
<mt:send/n>
</mt:mail>
</body>
</html>

---------------------------------------------------------------------------
i've downloaded the taglib from Apache tomcat site and copied to WEB-INF folder.. the jar file i copied to /WEB-INF/lib folder and the tdl i copied to the /WEB-INF
in the web.xml file i edited the following things
---------------------------------------------------------------------------

<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/mailer-1.1</taglib-uri>;
<taglib-location>/WEB-INF/taglibs-mailer.tld</taglib-location>
</taglib>
</web-app>

---------------------------------------------------------------------------

this is showing the runtime error
the error is this
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: javax/mail/Authenticator
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.NoClassDefFoundError: javax/mail/Authenticator
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
java.lang.Class.getDeclaredMethods(Class.java:1763)
java.beans.Introspector$1.run(Introspector.java:1265)
java.security.AccessController.doPrivileged(Native Method)
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
java.beans.Introspector.getBeanInfo(Introspector.java:387)
java.beans.Introspector.getBeanInfo(Introspector.java:159)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3667)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2092)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1598)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1458)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2230)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2236)
org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Generator.generate(Generator.java:3255)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

How can i fix this problem.. please help me ranchers..

thanks in advance!!

regards

Megha Rajeev
17 years ago
Thank you ranchers..
this query is working fine..
but there is a problem also..
if i want to get the current value of the sequence.. what to do

i've done like this


String query = "select system.login_id.currval from dual";
ResultSet rs = stmt.executeQuery(query);
while(rs.next())
{int id_val = rs.getInt(1);
}


i don't kjnow whether it is true..
just put a trial..
but it is showing the error..

java.sql.SQLException: [Oracle][ODBC][Ora]ORA-08002: sequence LOGIN_ID.CURRVAL is not yet defined in this session


but if i'm giving the nextval.. it is working fine..
how to fix this problem..
please help me ranchers..

thanks in advance

regards
Megha
Hello Ranchers
how to insert a integer value which is in sequence
please help me

the query i'm using is

=========================================================================

String query = "insert into test(id,name,sex)values(s_id.nextval,?,?))";

PreparedStatement ps = dbCon.prepareStatement(query);
ps.setInt(1,id);
ps.setString(2,name);
ps.setString(3,sex);

=========================================================================

but what if i'm inserting a string value in a sequence.. then i just want to give ps.setString(1,"");
it will insert
but now i want to give the integer value
so which one i can use..
please help me ranchers..

thanks in advance..
regards
Megha!!
Thank u RancherS!!
Now the query is executing successfully..
I don't know what happened to it yesterday
when ever i try to insert the values it was inserting 2 times..
and when i restarted my system..
it is ok now

i think there is some problem with the system cache..

any way thank you very much
for your great support..

regards
Megha
Exactly Aravind.
But how to insert the value to a variable..
or else.. we have to write another query.. and get the last value stored in the array like this
this is just an example


select id from table_name order by id;
ArrayList test = new ArrayList();
while(rs.next())
{
test.add(rs1.getString(1));
}
Object t[] = test.toArray();
int leng = t.length;
String new_reg_val= t[leng];



like this it is ok..
but if there is any query or something like this
then that will reduce the pain..

any way ranchers will help!! for that

regards
Megha
Exactly Aravind.
But how to insert the value to a variable..
or else.. we have to write another query.. and get the last value stored in the array like this
this is just an example


select id from table_name order by id;
while(rs.next())
{
}
Hello Aravind..
If i'm using some 2 tables..
reg_id is the primary key of 1st table..
using this id only we are inserting the user details to second table

if i want to insert the value to next table.. then
i want to get the reg_id which is stored in the table.. isn't it..
so how can i get that value..

please help me..

thank you
regards
Megha
thanks for the reply..
but it is not working properly..

the acrobat reader is opening.. with a message box..

this is the content of the message box
" Adobe Reader couldnot open the file test[1].pdf because it is not either a supported file type or because the file has been damaged.(for example, it was sent and email attachment and wasn't correctly decoded)"

this is the error message i'm getting..
so what to do now..
the page contains table format and all..
i've give the code like this

<%@ page language="java" session="true" import="java.sql.*" import="java.lang.*" contentType="application/pdf" %>
<%
response.setHeader("Content-Disposition","attachment;filename=test.pdf");
%>


please help me for fixing the problem

thanks in advance

regards
Megha
17 years ago
JSP
Hello Ranchers..
I'm doing a project in JSP and Oracle..
Here in my project there are two types of department..
Accounts and Sales..
Accounts department is able to download some pages to Excel format and it is working properly..

now in the sales they have to download in pdf format.. then only it is possible to send to the HO..
now what they are doing is downloading the JSP page in excel format and converting to pdf manually using the Acrobat Printer..

is that possible to change to pdf format..

for converting to excel format.. i'm just using 2 lines
and it is here


<%@ page language="java" session="true" import="java.sql.*" import="java.lang.*" contentType="application/vnd.ms-excel" %>
<%
response.setHeader("Content-Disposition","attachment;filename=test.xls");
%>

in the filename side i chaged to test.pdf..
and in the contentType i changed to Acrobat reader
and it is downloading but cannot view the conten..

please help me ranchers.. to solve this problem..

thanks in advance..

regads
Megha Rajeev
17 years ago
JSP
Hello Ranchers..
I'm using JSP and Oracle for the project..
now in one of the table there are 1000 records.. when a user click the search button.. All the records are displaying in the page..
for that displaying purpose i used <iframes> </iframes>..
in this iframes i put the frameborder="0" and scrolling="auto".. So if the record is more that 10 it will automatically shows the scroll bar..

now i've to put only 10 records in the page.. and when i click next button the iframe shows 11-20 records and in next again 21 to 30.. like that..

please help me ranchers
how to code that.. is that any oralce query. or what..

please reply me..
thanks in advance..

regards
Megha..
hello Shalish..
Thanks for replying and sorry for the lack of information..
Actully it is showing the error.. invalid column name.
ie., reg_no.nextval is a invalid column name..

what should i do to insert the auto number..

please help me ranchers..

thanks in advance

regards
Megha
Hello Ranchers,
I'm doing a program in JSP and Oracle.. In that the oracle table details are here
------------------------------------------------------
column
------------------------------------------------------
reg_no
name
password
confirm
-------------------------------------------------------

in this table the reg_no is a primary key and there is a sequence
ie., the number starts with 1000 and increment by 1

now from the jsp page.. i want to insert a new user registation details..

at that time the query i;m using is
insert into table_name (reg_no,name,password,confirm)values (reg_no.nextval,name,password,confirm);

but it is not inserting and showing errors..
so what should i do to insert the values in to the table where there is a sequence and a primary key!!

please help me.. ranchers..
thanks in advance

regards

Megha Rajeev
Hello Ranchers
I've a trouble in implementing the javascripts in JSP page
It is working properly!! I have checked through out the internet and couldn't even find a solution!!
I'm doing a project -- ACCOUNTS SYSTEM!!
for that displaying up to the ledger is OK
now..
after retrieving the datas from the table the jsp page will be looking like this
the first row of the table contains
1) check box
2) Details
3) VAT TYPE
4) VAT DETAILS
_________________________________________________________________
check |Details |combo box |textbox |
| |(default : disable) |(default:readonly) |
__________________________________________________________________
chk1 |rs.getString(1) |combo box containing 3 items | display what is|
chk2 |rs.getString(2) |standard, excempt,zero rate | selected in the|
chk3 |rs.getString(3) | |combo | ______________________________________________________________________
and the corresponding rows below that contains the datas from the database
___________
now there is the use of scripts
when the page is loading all the combo box will be disabled and all the text box will be in read only
so.. when i'm checking the first checkbox.. in the table header
all other checkbox should also select (like a select all button in the email clients like yahoo.. gmail and all)
at the same time the corresponding combo box should also get enabled!!
and then only it can be able to select the values from the combo.. which ever value is selected it should display in the textbox corresponding to that combo!!
i think you all understood what i meant!!
and help me..

i don't really know the complexity of this
please help for doing my project well!!
thanks in advance!!

regards

Megha
Hello Ranchers!!
Sorry to send this in JSP forum since i didn't found javascript forum!!
I've a trouble in implementing the javascripts in JSP page
It is working properly!! I have checked through out the internet and couldn't even find a solution!!
I'm doing a project -- ACCOUNTS SYSTEM!!
for that displaying up to the ledger is OK

now..
after retrieving the datas from the table the jsp page will be looking like this
the first row of the table contains
1) check box
2) Details
3) VAT TYPE
4) VAT DETAILS
____________________________________________________________________
check |Details |combo box |textbox |
| |(default : disable) |(default:readonly) |
____________________________________________________________________
chk1|rs.getString(1)|combo box containing 3 items| display what is|
chk2 |rs.getString(2)|standard, excempt,zero rate | selected in the|
chk3 |rs.getString(3)| |combo |_____________________________________________________________________

and the corresponding rows below that contains the datas from the database
___________

now there is the use of scripts
when the page is loading all the combo box will be disabled and all the text box will be in read only
so.. when i'm checking the first checkbox.. in the table header
all other checkbox should also select (like a select all button in the email clients like yahoo.. gmail and all)
at the same time the corresponding combo box should also get enabled!!
and then only it can be able to select the values from the combo.. which ever value is selected it should display in the textbox corresponding to that combo!!

i think you all understood what i meant!!
and help me..
i don't really know the complexity of this
please help for doing my project well!!

thanks in advance!!
regards megha!!
[ April 11, 2006: Message edited by: Bear Bibeault ]