473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to call a java class from jsp?

Hi all,

Suppose i've my database operations written in a java class, db.java , i want to call this from my jsp page as soon as the data is entered.
Pls tell me how to do this
Jun 13 '07 #1
4 10265
dmjpro
2,476 2GB
Hi all,

Suppose i've my database operations written in a java class, db.java , i want to call this from my jsp page as soon as the data is entered.
Pls tell me how to do this

that means u want to access the db.class file from u jsp page.
right????
do u konw to how to embed java code in ur jsp page?
if u do then u can do it urself.
best of luck.

kind regards,
dmjpro.
Jun 13 '07 #2
r035198x
13,262 8TB
Hi all,

Suppose i've my database operations written in a java class, db.java , i want to call this from my jsp page as soon as the data is entered.
Pls tell me how to do this
Just make sure the class is in a folder that is accessible to the JSP and import it appropriately.
Jun 13 '07 #3
that means u want to access the db.class file from u jsp page.
right????
do u konw to how to embed java code in ur jsp page?
if u do then u can do it urself.
best of luck.

kind regards,
dmjpro.
right now i'm doing the same but my application has become very slow. Business logic shud b separate from presentation right.. So how it can b done
Jun 13 '07 #4
praveen2gupta
201 100+
Hi

You should use Java Beans for using classes in the jsp Page. Store your java class file in the WEB-INF/classes folder. call them by defining Java Bean at the start of JSP page. your application will run faster.

Tag of jsp Bean is as follows
Expand|Select|Wrap|Line Numbers
  1.  
  2. <jsp:useBean id=" " scope="page" class=" "/>
  3.  
  4.  
Jun 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: parthan | last post by:
We are running our c++ program as Windows services which uses JNI. > Program is getting CLASSPATH env variable correctly and also > initializes JVM successfully. After initializing JVM, programs...
5
by: Ayesha Ahsan | last post by:
Hi, I use Runtime.getRuntime().exec(command) to make my system call. For Windows based Dos, i add "cmd /c" before I type in my system call. So for example make the system call "dir": String...
0
by: aychai | last post by:
Hi all, I am trying to make use Oracle9i db to call an external .Net Web Service from a JAva Stored Procedure. I created the .Net Web Service and use JDeveloper 9.0.3.4Build(1247) to create...
6
by: Eugene A | last post by:
Hello. In this call from a Java prog to a Oracle SP I am trying to pass along some varchars and a cursor, but apperently the syntax of the call to the stor proc is incorrect. What am I doing...
4
by: Jean-Marc Blaise | last post by:
Dear all, I have simulated the windows MULTI application with a java program calling the SQLTP1DL proc referenced as DB2DARI application, on Linux Intel or ZLinux. If the proc is NOT FENCED,...
12
by: karen | last post by:
Hi all : this is going to be a long post. So i apologize in advance :) i am converting a java program in VB right now. I am a java programmer by trade. so i am no expert in this department. I...
46
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
11
by: Rahul | last post by:
Hi Everyone, While working with Java, i came across super() which passes values to base class constructor from derived class constructor. I was wondering if this could be implemented in c++ by...
11
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
6
by: Christopher | last post by:
Its been awhile and I am rusty. Can the constructor of my class call another method in the same class if that other method does not change any member data? I want to simply have a seperate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.