Applet to database error


Applet to database error

I had an application where i need to connect to the database for the values to display in the applet....
Following is a part of that...
The code works fine in the local system..
but when its not working over the net..
When i placed this in the server,
The local system is displaying null values as the result...

public class circuit extends Applet implements MouseListener{
boolean rect1Clicked,rect1Clicked1,mouseEntered;
RTextLine text = new RTextLine();
Connection con=null;
Statement stmt,stmt1,stmt3;
ResultSet rs,rs2;
String str1,str2,str3,str4,s1,str5,str6;

public void init(){




catch(Exception e){


public void mouseClicked (MouseEvent me) {

int xpos= me.getX();
int ypos= me.getY();

if(xpos>=25 && xpos<=35 && ypos>=540 && ypos<=645)

rect1Clicked = false;
public void paint(Graphics g) {
....Some Painting Lines Code Here....
if (rect1Clicked)

g.drawString("("+str1+", ",80,690);
...Some Painting Lines Code Here...
public void res(String s) {
String mid=null;

ResultSet rs3=stmt3.executeQuery("select mid from table1 where lname='"+s+"';");


ResultSet rs = stmt1.executeQuery("select Frequency,RPhaseVoltage,ActivePower from mydb.instantaneousdata where meterid='"+meterid+"';");
rs2 = stmt.executeQuery("SELECT ActiveExportTotal,StartDate,StartTime FROM mydb.energysnapshotdata where mid='"+mid+"';");

str1 = rs.getString("Frequency");
str2 = rs.getString("RPhaseVoltage");
str3= rs.getString("ActivePower");

str5= rs2.getString("StartDate");
str6= rs2.getString("StartTime");

catch(Exception e){


This is my code....

There r some code left which i didn't included in the above it is a very large code which isn't necessary for finding the error...
as itz only drawing strings or lines...

PLs help..
thanx in advance
View Answers


Related Tutorials/Questions & Answers:
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local... in but came error below... java.sql.SQLException: JZ006: Caught IOException
how to add database in Java Applet
to add database in Java Applet below this code is my applet source code . to add database in Java Applet  hi every java master or Java... Applet implements ActionListener{ TextField
Database error - WebSevices
Database error  Hello, How i connect my database file& tables to Zend library file Using PHP language. In which library file i should change that code. Any one know the exact changes. Tell me.   http
error oracle database connection?
error oracle database connection?  hi now i am trying to connect oracle database and also insert my data into table, but it's not working.. I created one user registration form. when i give values in the form, i want stored data
Error with LogIn with mysql database
Error with LogIn with mysql database  Hi, I have followed steps from your tutorial titled SpringMVClogin with database. I am not using Jetty, as I... 404 page error. In Tomcat console it states the reason as: "Error creating bean
connection database error
connection database error  import java.awt.EventQueue; // import packages import java.awt.event.ActionEvent; import java.awt.event.ActionListener...;which type of error occurs? Specify it. Is NWIND is your dsn
error log and send Database
error log and send Database  hi my requirement is validate xml and xsd in java.If there is an errors then i will log error and store into error table. so plz if any one knows send code urgent. error table details
applet connected to table in MS Access database
applet connected to table in MS Access database   i have connected my java code with the MS access database and this is my code, can anyone tell me how to show the table in an applet...pls import java.sql.
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
Applet  how to run an applet on a web browser
applet  Explain different stages in the lifecycle of an applet with figure.   Stages of Applet: Life cycle of an Applet: init(): This method is called to initialized an applet start(): This method is called after
Applet  Give the class hierarchy of an Applet class
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
Applet  Explain the start() and stop() methods of applet life cycle.   Start and Start method of Applet Life Cycle Start () method: The start method of an applet is called after the initialization method init
Applet  Write a short note on applet life cycle
Applet  I have a java applet that has a button. On clicking the button it should disappear and another applet should appear. How to write this code???? Also in login applet after successful login it should display admin applet
Display error message if data is already inserted in database
Display error message if data is already inserted in database   Display error message if data is already inserted in database Pls help me Thanks
Applet  Draw the class hierarchy of an Applet class. Also explain how to set background and forground colors in java
how to retrieve data into combo from database in java applet?
how to retrieve data into combo from database in java applet?  hi,. i have written applet codes for linking two frames and database connectivity but the problem is, the database is not retrieving data into the combo..please
applet  what is applet in java   An applet is a small program that can be sent along with a Web page to a user. Java applets can perform... the following link: Applet Tutorials
Applet  Write a Java applet that drwas a line between 2 points. The co-ordinates of 2 points should be passed as parametrs from html file. The color of the line should be red
applet  applet to open new tab not's my code import java.applet.*; import java.awt.*; import*; import java.awt.event.*; public class NewURL extends Applet implements ActionListener{ public void init
getting error while inserting values in database
) { out.println("An Error Had occurred while accessing the database...getting error while inserting values in database"); if (envContext == null)throw new Exception("Error: No Context
java applet
java applet  If i insert in database from applet this work, but from applet.html don't
jQuery auto complete through database using JSP shows error
jQuery auto complete through database using JSP shows error  The tutorial on jQuery titled "jQuery auto complete through database using JSP" shows error on browser when I try to select the one in the dropdown. Please help
error in uploading image from jsp to oracle 10g database
try to insert into the image into the database i got the above error please advice how to get rid of error   JSP upload image in Mysql database...error in uploading image from jsp to oracle 10g database  
Applet Graph
Applet Graph  hai, iam new to java plz help me.. 1..i have a table of information(column names) from database(mysql) 2..i have to select any two... a graph between those columns in a applet plz send me the code thank u
Applet JSP communication - Applet
Applet JSP communication  Hi.. I've an application where i need to get the data from the applet to JSP... How can i do this..?? can anyone explain with a sample code
applet Question
applet Question  Write a java applet to display a circle in a rectangle
applet question
applet question  Write a java applet to display a rectangle inside a circle
applet question
applet question  Write a java applet to display atriangle inside a circle