rajani adapa

Ranch Hand
+ Follow
since Jan 24, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by rajani adapa

Sorry ,
Oops!! I FORGOT TO INCLUDE THE PACKAGE IN SPECIFIED DIRECTORY.
sORRY FOR THE INCONVENIENCE.
And now i got it's working fine.
Once again thanku very much
rajini
23 years ago
Thank you .
It's working now.
And i 've one more question.
IAm trying to use bean in my client program.
When iam trying to include all three files in a single package as,package mypkg;
in all three files of my rmi application,Neither of my server and client not accessing the interface.
What is the problem?
please correct me if iam wrong
rajini
23 years ago
WHen i run my server in the rmi program iam getting an error message saying,
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
I've no idea what is going on over there.
Can anybody help me
please........
rajini
23 years ago
Iam trying to run the rmi program.
Like,i compiled all three files.
And entered rmiregistry in command window.
Also rmic -v1.2 RemteHelloImpl.
(remteHelloImpl is my implementation file).
And when i run the server as java RemteHelloImpl
Iam getting an error message saying
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)

Iam very new to rmi.
can anybody help me in this regard.
please...
rajini
23 years ago
Thank u guys.
bye
rajini
23 years ago
sorry, but now it is,
C:\JSDK2.0\examples>javac postparametersservlet.java
postparametersservlet.java:50: illegal character: \92
q="insert into choices(bookname, isbnnumber)values("\'"+data+"\'",'1234')";
^
postparametersservlet.java:50: unclosed character literal
q="insert into choices(bookname, isbnnumber)values("\'"+data+"\'",'1234')";
^
postparametersservlet.java:50: unclosed character literal
q="insert into choices(bookname, isbnnumber)values("\'"+data+"\'",'1234')";
^
postparametersservlet.java:50: unclosed character literal
q="insert into choices(bookname, isbnnumber)values("\'"+data+"\'",'1234')";
^
postparametersservlet.java:50: unclosed string literal
q="insert into choices(bookname, isbnnumber)values("\'"+data+"\'",'1234')";
^
5 errors
23 years ago
if i do
"insert into choices(bookname, isbnnumber)values("'"+data+"'",'1234')"
this is the output:
C:\JSDK2.0\examples>javac postparametersservlet.java
postparametersservlet.java:50: unclosed character literal
q="insert into choices(bookname, isbnnumber)values("'"+data+"'",'1234')";
^
postparametersservlet.java:50: unclosed character literal
q="insert into choices(bookname, isbnnumber)values("'"+data+"'",'1234')";
^
postparametersservlet.java:50: unclosed character literal
q="insert into choices(bookname, isbnnumber)values("'"+data+"'",'1234')";
^
postparametersservlet.java:50: unclosed string literal
q="insert into choices(bookname, isbnnumber)values("'"+data+"'",'1234')";
^
4 errors
23 years ago
I changed the database.now it's working.
But the problem is iam trying to insert into table choices.
if i type,
"insert into choices(bookname, isbnnumber)values('java','1234')"
it's inserting the string java and 1234.
now,
what i want to do is,
i want to insert data where data is a variable whose value is java.
what is wrong with this?
"insert into choices(bookname, isbnnumber)values(data,'1234')"
thanks in advance
rajani
23 years ago
i don't think there is a necessity for username and password to be associated with accssing a database
rajani
23 years ago
Yes,
i did register my database in odbc administrator in control panel.
what should i do now?
thanks in advance
rajini
23 years ago
Thank u.
it's working.but,i've another question.
I want to create a database that stores information about customer choices.Like,my html page contains a choice of text books.Corresponding to the selection the user made, i want to insert the isbn number of the book in the database.
If i try to do that iam getting an error message saying that"no db".
please check this out.
import java.io.*;
import javax.swing.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class postparametersservlet extends HttpServlet
{
private Connection connection;
private JTable table;
String url="jdbc dbc:book";
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
String isbn[]={"1234","34234","45362","78960"};
String name[]={"java","c++","c","oracle"};
String data=request.getParameter("data");
Cookie c=new Cookie("java","isbn");
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
response.addCookie(c);
pw.println("<html><head><title>");
pw.println("cod cookies");
pw.println("</title></head><body>");
pw.println(data);
pw.println("</body></html>");
pw.close();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection=DriverManager.getConnection(url);
}
catch(ClassNotFoundException cnf)
{
System.out.println("no class");
}
catch(SQLException sqle)
{
System.out.println("no db");
}
try
{
Statement s=connection.createStatement();
String q;
if(data.equals("java"))
{
q="insert into choices(bookname, isbnnumber)values(data,isbn[0])";
connection.nativeSQL(q);
int result=s.executeUpdate(q);
if(result==1)
System.out.println("successfull");
else
System.out.println("unsuccessfull");
s.close();
}
}
catch(SQLException sqle)
{
System.out.println("failed access");
}
}
}
23 years ago
I want to create a database that stores information about customer choices.Like,my html page contains a choice of text books.Corresponding to the selection the user made, i want to insert the isbn number of the book in the database.
Iam not sure if it is the correct way of doing it.
import java.io.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class cookie1 extends HttpServlet
{
private Connection connection;
private JTable table;
String url="jdbc dbc:book";
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
String isbn[]={"1234","34234","45362","78960"};
String name[]={"java","c++","c","oracle"};
String data=request.getParameter("data");
Cookie c=new Cookie("java","isbn");
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
response.addCookie(c);
pw.println("<html><head><title>");
pw.println("cod cookies");
pw.println("</title></head><body>");
pw.println("
welcome to cod cookies");
pw.println("
");
pw.println("dexter is a good dog");
pw.println("</body></html>");
pw.close();
}//end of dopost
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
PrintWriter pw;
Cookie cookies[];
cookies=request.getCookies();
response.setContentType("text/html");
pw=response.getWriter();
pw.println("<html><head><title>");
pw.println("cod cookies");
pw.println("</title></head><body>");
pw.println("</body></html>");
pw.close();
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection=DriverManager.getConnection(url);
}
catch(ClassNotFoundException cnf)
{
System.out.println("no class");
}
catch(SQLException sqle)
{
System.out.println("no db");
}
try
{
Statement s=connection.createStatement();
String q="insert into choices(bookname, isbnnumber)values('1000','norrisio')";
connection.nativeSQL(q);
int result=s.executeUpdate(q);
if(result==1)
System.out.println("successfull");
else
System.out.println("unsuccessfull");
s.close();
}
catch(SQLException sqle)
{
System.out.println("failed access");
}
}
}
}//end of class
Iam trying to view the changes that i made in my html by using servlet,as
import javax.swing.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class postparametersservlet extends HttpServlet
{
private Connection connection;
private JTable table;
String url="jdbc dbc:book";
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
String isbn[]={"1234","34234","45362","78960"};
String name[]={"java","c++","c","oracle"};
String data=request.getParameter("data");
Cookie c=new Cookie("java","isbn");
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
response.addCookie(c);
pw.println("<html><head><title>");
pw.println("cod cookies");
pw.println("</title></head><body>");
pw.println(data);
if(data=="java")
{
pw.println(isbn[2]);
}
pw.println("</body></html>");
pw.close();
}
}
and my html is,
<html>
<body>
<center>
<form name="Form1" method="get" action="http://localhost:8080/servlet/postparametersservlet">
select the Name of the book<select name="data">
<option value="java" selected>java
<option value="c++">C++
<option value="c">C
<option value="oracle">oracle
</select><br><br>
<input TYPE="SUBMIT" ></body>
</html>
Like if i select the book "java" it has to display the isbn number of the book.
Is there anything wrong in that?
please help me.
rajani
23 years ago
<html>
<head>
<body>
<p>user id:<input name="fname" type=Text maxlength=30 size=30></p>
<p>password:<input name="fname" type=Text maxlength=30 size=30></p>
<p><a href="c:/raji/mail/c.html">enter</a></p>
<p><i>new user</i><a href="c:/raji/mail/b.html">register me</b></a></p>
</body>
</head>
</html>

My question is:I just wants to store the data the user entered in the register page in a database.
How to connect the database with the webpage.
Thanks in advance.
bye
rajani.
Thanks Ajith.
what is this?i've never heard about the
IBM Certified Developer - XML and Related Technologies, V1.
is this also like sun certification.where can i get information regarding this.
rajini