Link to home
Start Free TrialLog in
Avatar of Manikandan Thiagarajan
Manikandan ThiagarajanFlag for India

asked on

Eclipse-how to work with simple program

Hi all

I have downloaded Ecllipse. i have an ecllipse folder in desktop.

how to work simple program in that.

i think ecclipse  is anIDE environment.could i need to download any other tool

for working with ecclipse.

This is my sample program.

<%@ page language = "java" import ="java.sql.*" %>
<html>
<body>
<%
Connection con = null;

try
{
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      con = DriverManager.getConnection("jdbc:odbc:ss","sa","");
      Statement st = con.createStatement();
      ResultSet rs = st.executeQuery("select * from customer");
      %>
            <table border =2>
            <%
            while(rs.next())
      {
            %>
            <tr>
            <td><%= rs.getString(1)%></td>

            <td><%= rs.getString(2)%></td>

            <td><%= rs.getString(3)%></td>

            </tr>

            <%
      }
            %>
            </table>
            <%
}
            catch(Exception d)
            {
                  out.println("can not display the records");

            }
            %>
            </body>
            </html>
How to save this program and test the program in ecclipse.

I aware that Hibernate . could i down load hibernate ?

which one is better, ecclipse or hibernate  

which tool should be better for test this program.I have sqlserver 2005.
SOLUTION
Avatar of radarsh
radarsh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of radarsh
radarsh

Hibernate is not an IDE. Its a technology for Data Persistence. Eclipse
is an IDE where you can work on many kinds of projects.
Avatar of Manikandan Thiagarajan

ASKER

>>you have to create a Dynamic Web Project in Eclipse

where i see the option in ecclipse?

how do i select the tomcat server
stmani2005,

go to File -> New -> Project -> Web -> Dynamic Web Project

Forgot to mention one very important thing here. You need to have
the eclipse with Web Tools Plugin distribution. You can download it
here...

http://download.eclipse.org/webtools/downloads/

________
radarsh
could you specify the name of the link to download for webtool
>>could you specify the name of the link to download for webtool

What I specified in previous post is called a link.

________
radarsh
wtp-all-in-one-sdk-1.0-win32.zip.

is this a  file i have to download?

where i save it?
stmani2005,

Exactly!! That "is" the file. Its is eclipse itself but with the
additional plugins. Extract and start using it.
________
radarsh
>Extract and start using it.

sometimes when you add a plug-in eclipse you need to restart Eclipse itself to take the new changes.
This the bundled version of eclipse. Not the plugin itself.
So, essentially you are installing a new eclipse.

The concept of restarting doesn't arise when you haven't started it at all!!

:)

________
radarsh


HI Radarsh,Giant

i create a  context root under dyanmic web project. that name is called jdbc jsp.

where i could paste the above code and test that jsp code.

could you please explain simple?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well , i paste the code and save it as jdbc.jsp under jdbcjsp

how to connect with tomcat server and run this program?.

if i  click run button that gives the output for previous helloworld program.

how to change this program in to runtime environment?
you may set your jdbc.jsp file answer to request.
You must define the context (if not defined) and so on. The same things if your are working with Tomcat.
hi,i set context jdbcjsp inside the tree view i have jdbc.jsp

how to run jdbc.jsp.
it doesnot support tomcat 4.1 it support only tomcat 5.0 and tomcat 5.5

i have only tomcat 4.1 version.

what i do now?
You right-click on your JSP and select

Run As -> Run on Server


________
radarsh
i clck that run on server  select default server

when i click run after that i enter into create manage and run configuration wizard.

what i specify debug and run text boxes





now i install tomcat5.5

i have jdbcjsp folder ---webcontent---jdbc.jsp

when i right click jdbc.jsp and select run as on server


 that would shows the error like no launchable artifact could be found this session

when i right click jsbcjsp folder and select runon server,it starts the server

it open the browser and says  the page can not be displayed

the url like http://localhost:8080/jdbcjsp

could you please explain step by step to solve the problem?


>http://localhost:8080/jdbcjsp
I do not see the DOT "."  Maybe you forget during editing file?
when i right click jdbc.jsp and select run as on server
 that would shows the error like" no launchable artifact could be found this session"

how to solve that error

see the log because I think you didn't put the jsp in the right WebContent
where i go to see the log
If you use the inner Tomcat (buld in Eclipse), you can find something in the Window->Show View->Other and search for the tomcat log
Where did u put ur JSP? Under which directory? Can you give the tree structure? Something like this...

-Root
    -WEB-INF
        +classes
        +lib
         web.xml
 jdbc.jsp


________
radarsh
-Root - jdbcjsp

                 -src

                -Webapplibaries

                  -build

-webcontent

         Meta-inf

         web -inf

             web.xml

        jdbc.jsp


is that correct

now i start the server from ecclipse that would started.now that would not open any browser.i could not able to see any output.

could i supply any url to see the output.