anu rani

Greenhorn
+ Follow
since Aug 29, 2006
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 anu rani

i have a program whatever i write the code in else loop it is not working.
String s = request.getParameter("username");
String pass=request.getParameter("password");
out.println("username"+"<br>"+s);
out.println("pass"+"<br>"+pass);
String pwd=null;
Statement st=null;
ResultSet rs=null;
Connection con=null;
ConnectionBean1 cb = new ConnectionBean1();
con = cb.getConnection();

String str="select password,status from login where username='"+ s +"' and password='"+pass+"' ";
out.println(str);
st =con.createStatement();
rs=st.executeQuery(str);

while (rs.next())
{
stat=rs.getString("status");
pwd=rs.getString("password");

}
out.println("stat"+stat);

out.println("pass"+pass);
out.println("pwd"+pwd);

rs.close();
st.close();
con.close();
if(pwd.equals(pass))
{
out.println("successfull login");
response.sendRedirect("../mobile4/view.jsp");
}
else
{
out.println("please try again");
response.sendRedirect("../mobile4/err.jsp");
}


}
catch(Exception exception)
{



out.println(exception.toString());
}
%>
13 years ago
JSP
I am getting Array index out of bound exception so please help in solving the error
int i;
String[] loca=new String[10];
if(request.getParameter("location") != null)
loca = request.getParameterValues("location");

for(i=0;i<=loca.length;i++)
{
out.println("loca"+"<br>"+loca[i]);


}
13 years ago
I want in detail how to connect to oracle databse.

Regarding classpath,what to install.

I have j2sdk1.4.2,oracle8i,tomcat6.0

Class.forName("Oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.10.5:1521:bits", "buildnova", "nova");
error:
java.lang.ClassNotFoundException: Oracle.jdbc.driver.OracleDriver
please let me know how to resolve this error
I have selected single location in a list box and pass the arg to the next jsp program using request.getParameter.
then i wrote a query "select * from search where location=selected location in the listbox" and it retrieved all the data from the databse pertaining to taht location.

If i select multiple locations how to pass the multiple locations to the next jsp program and how to retrieve data for the multiple locations from the databse using resultset. i need the code. please help urgent
13 years ago
JSP
There are some locations dispalyed in a list box. I have select 3 locations. so I need to displayed the result i.e., (the data present in the databse corresponding to the locations) of all the 3 locations at a time. please help me how to do the code in jsp
13 years ago
JSP
i have insatlled javawebserver 7.0 and how do i know that it is running successfully and what changes i have make in the CLASSPATH
15 years ago
i want to deploy servlets in javawebserver do i need tomcat also for that or else only in javawebserver can we deploy
15 years ago
hey can one help me sending the source code for sessions. how to keep some login for example in a session in the servlet.
15 years ago
I will send you the three programs please tell me correct way in the progarms data1 data are the jsp programs in which i wrote databse conenction
LoginMidlet
package MIDlets;
import java.io.*;
import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;

public class LoginMidlet extends MIDlet implements CommandListener
{
private Display display;
private TextField userName;
private TextField password;
private Form form;
private Command cancel;
private Command login;
private Validate objMenu;


public LoginMidlet() throws Exception
{
userName = new TextField("LoginID:", "", 10, TextField.ANY);
password = new TextField("Password:", "", 10, TextField.PASSWORD);
form = new Form("Sign in");
cancel = new Command("Cancel", Command.CANCEL, 2);
login = new Command("Login", Command.OK, 2);
}

public void startApp()
{

display = Display.getDisplay(this);
form.append(userName);
form.append(password);
form.addCommand(cancel);
form.addCommand(login);
form.setCommandListener(this);
display.setCurrent(form);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
notifyDestroyed();
}

public void validateUser(String Password)
{
objMenu = new Validate();
if(password.equals("ProvPassword"))
{
objMenu.menu(display);
} else {
tryAgain();
}
}

public void tryAgain() {
Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR);
error.setTimeout(Alert.FOREVER);
userName.setString("");
password.setString("");
display.setCurrent(error, form);
}

public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("Cancel")) {
destroyApp(true);
} else if(label.equals("Login")) {
validateUser(password.getString());
}
}
}

Valiadte package MIDlets;

import java.io.*;
import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;

public class Validate extends MIDlet implements CommandListener {
private complaint objcomplaintRequest;
Display display;
private String getURL="http://localhost/jspprograms/data.jsp?userName=ProvID&password=ProvPassword";

public void menu(Display display) {

this.display=display;
List services = new List("Choose one", Choice.EXCLUSIVE);
services.append("Your request/Response", null);
services.append("Sign Out", null);
services.setCommandListener(this);
display.setCurrent(services);

}


public void startApp()
{

try {

HttpConnection conn = (HttpConnection) Connector.open(getURL);
conn.setRequestMethod(HttpConnection.POST);
conn.close();

} catch (Exception e) {
System.out.println(e.getMessage());
}
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}



public void commandAction(Command c, Displayable d) {
objcomplaintRequest=new complaint();
String label = c.getLabel();
if(label.equals("Your request/Response")) {
objcomplaintRequest.complaint();
} else if(label.equals("Sign Out")) {
destroyApp(true);


}
}
}
compalint
package MIDlets;

import java.io.*;
import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
class complaint
{

private String getURL="http://localhost/jspprograms/data1.jsp";
public void startApp() {

try {

HttpConnection conn = (HttpConnection) Connector.open(getURL);
conn.setRequestMethod(HttpConnection.POST);
conn.close();

} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}



}

one error is comingProject "LoginMidlet" loaded
Settings updated
Project settings saved
Project settings saved
Building "LoginMidlet"
C:\WTK25\apps\LoginMidlet\src\Validate.java:52: cannot find symbol
symbol : method complaint()
location: class MIDlets.complaint
objcomplaintRequest.complaint();
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed
15 years ago
because ia mgetting sql errors when i write a jdbc program in midlets.ResultSet error DriverMangaer error etc...
I have 3 midlets but code to be displayed should be in first midlet . but in the emulator all the names of 3 midlets are being displayed how should code be to interlink the 3 midlets
15 years ago
Do we need to download both iis and tomcat to run jsp files
15 years ago
JSP
There will be two files jsp files and midlets. jspfor writing the databse code and midlets for displaying in the mobile what we want. so how to link these twoo programs jap midp to get the final result.
15 years ago
JSP
Can i run JSP files in IIS server if possible where to palce these jsp files. Please let me know
15 years ago
JSP