Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Derby version and Eclipse version?
Derby version and Eclipse version? [message #210412] Sun, 16 March 2008 03:46 Go to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

A beginner, I'm trying to follow the Dai/Mandel/Ryman Quick Tour chapter
(of Eclipse Web Tools Platform: Developing Java Web Applications) where
it uses Derby to demonstrate database access.

I duly downloaded and installed the Derby plug-in (10.3.2.1), but it's
many revs past the one in the book (10.1.2.1) and I'm pretty sure that
the authors were not using the latest Eclipse by the time the book went
to print (May 2007).

When it comes down to eliciting views for working with databases
(looking for Database Explorer and Data Output), I follow the
instructions thus:

- Window->Show View->Other (get the Show View dialog)

- Expand the Data category which will reveal the two views mentioned.

There's the rub: there is no data category, nor is there any other item
in the list under which I can find Database Explorer and Data Output as
per the tutorial. The list I get is at the end of this question.

Does anyone have experience with this? Has Eclipse moved on? Just Derby?
Both?

I downloaded Eclipse JEE two months ago. I see Version 3.3.1.1,
M20071023-1652.

Thanks,

Russ Bateman


Show View list: General, Ant, Cheat Sheets, Connectivity, CVS, Debug,
Help, Java, Java Browsing, JPA Development, Mylyn, PDE, PDE Runtime,
Server, SQL Development, SVN, Team.
Re: Derby version and Eclipse version? [message #210420 is a reply to message #210412] Sun, 16 March 2008 20:19 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence Mandel
Messages: 486
Registered: July 2009
Senior Member
Hi Russ,

The data tools have moved from the Web Tools Platform (WTP) to the Data
Tools Platform (DTP)[1]. Install DTP (included in the WTP all-in-one
build) and select Window->Show View->Connectivity->Data Source Explorer.

[1] http://www.eclipse.org/datatools/

Lawrence Mandel
-
Co-author Eclipse Web Tools Platform: Developing Java Web Applications
http://www.eclipsewtp.org
Re: Derby version and Eclipse version? [message #210471 is a reply to message #210420] Tue, 18 March 2008 01:20 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

lmandel@ca.ibm.com wrote:
> Hi Russ,
>
> The data tools have moved from the Web Tools Platform (WTP) to the Data
> Tools Platform (DTP)[1]. Install DTP (included in the WTP all-in-one
> build) and select Window->Show View->Connectivity->Data Source Explorer.
>
> [1] http://www.eclipse.org/datatools/
>
> Lawrence Mandel
> -
> Co-author Eclipse Web Tools Platform: Developing Java Web Applications
> http://www.eclipsewtp.org
>
>

After upgrading, I see Eclipse is 3.3.2 and in About Eclipse Platform
Features, I see Data Tools Platform 1.5.2.200802201, but still no Data.
See this window at http://www.windofkeltia.com/j2ee/show-view.jpg.
Re: Derby version and Eclipse version? [message #210507 is a reply to message #210471] Tue, 18 March 2008 13:03 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Windofkeltia wrote:
> lmandel@ca.ibm.com wrote:
>> Hi Russ,
>>
>> The data tools have moved from the Web Tools Platform (WTP) to the
>> Data Tools Platform (DTP)[1]. Install DTP (included in the WTP
>> all-in-one build) and select Window->Show View->Connectivity->Data
>> Source Explorer.
>>
>> [1] http://www.eclipse.org/datatools/
>>
>> Lawrence Mandel
>> -
>> Co-author Eclipse Web Tools Platform: Developing Java Web Applications
>> http://www.eclipsewtp.org
>>
>>
>
> After upgrading, I see Eclipse is 3.3.2 and in About Eclipse Platform
> Features, I see Data Tools Platform 1.5.2.200802201, but still no Data.
> See this window at http://www.windofkeltia.com/j2ee/show-view.jpg.

Never mind. I think what you're saying is that I will not see BOTH Data
and Database Explorer, but only Data Source Explorer.

Thank you for your time.

Russ
Re: Derby version and Eclipse version? [message #210515 is a reply to message #210471] Tue, 18 March 2008 13:50 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence Mandel
Messages: 486
Registered: July 2009
Senior Member
Hi Russ,

>After upgrading, I see Eclipse is 3.3.2 and in About Eclipse Platform
>Features, I see Data Tools Platform 1.5.2.200802201, but still no Data.
>See this window at http://www.windofkeltia.com/j2ee/show-view.jpg.

I get a 404 when trying to view your screenshot. The Data category in the
Views list has changed to the Connectivity category. Do you have a
connectivity category? If so, open the Data Source Explorer view.

Lawrence Mandel
-
Co-author Eclipse Web Tools Platform: Developing Java Web Applications
http://www.eclipsewtp.org
Re: Derby version and Eclipse version? [message #210543 is a reply to message #210515] Tue, 18 March 2008 22:37 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

lmandel@ca.ibm.com wrote:
> Hi Russ,
>
>> After upgrading, I see Eclipse is 3.3.2 and in About Eclipse Platform
>> Features, I see Data Tools Platform 1.5.2.200802201, but still no Data.
>> See this window at http://www.windofkeltia.com/j2ee/show-view.jpg.
>
> I get a 404 when trying to view your screenshot. The Data category in the
> Views list has changed to the Connectivity category. Do you have a
> connectivity category? If so, open the Data Source Explorer view.
>
> Lawrence Mandel
> -
> Co-author Eclipse Web Tools Platform: Developing Java Web Applications
> http://www.eclipsewtp.org
>

Sorry, after finally understanding the full extent of what you were
saying and that I had slightly misread your response, I realized that I
had got indeed what you said I would and so I deleted the screen shot as
unnecessary.

Sorry for the mix-up. I'm just getting time now to return to the
tutorial which I will continue on the basis you advised.

Copious thanks. I doubt I would have figured this out for myself.

Russ Bateman
Re: Derby version and Eclipse version? [message #210570 is a reply to message #210543] Tue, 18 March 2008 23:52 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

At the risk of boring everyone else, here's is what I ended up doing.

This relates to the Chapter 3 Quick Start tutorial set, iteration 3
circa page 73 of the book, Eclipse Web Tools Platform: Developing Java
Web Applications by Dai, Mandel and Ryman. If you've read this thread,
omitting my temporary befuddlement, you'll now know where to go to do
the database portion of the tutorial.

Lawrence Mandel's answer provided the necessary clue, but it wasn't
quite as simple as I had hoped.

Installing Derby and Eclipse Data Tools Platform (DTP) was the
beginning. Naturally, I installed the latest Derby, 10.3 just as I'm
using the latest Eclipse. However, this will not do.

For whatever reason, because of DTP not recognizing that Derby 10.3 was
out, I ended up having to install Derby 10.2.2 AND, as I only had 10.3.2
core, I also needed (or so I still think) the ui plug-in (1.1.0) and,
maybe, the doc (1.1.0). I hit upon the idea to install the earlier Derby
because that was the latest one noted in the UI I was crawling through
whereas 10.3.2, though installed, would not show up.

After getting those additional Derby plug-ins down into the Eclipse
plug-in subdirectory (a marvelous little piece of engineering this
plug-in business), I then needed to show Eclipse where the JAR files
were because the .xml file accompanying them isn't apparently sufficient.

At http://www.windofkeltia.com/j2ee/tut-images/derby-setup.jpg (and, I
promise I will leave the image there this time), I show how to edit and
place the valid path into the Derby Client JDBC Driver, used as the
driver definition, selected as the driver from the Driver and Connection
Details dialog. I went back to show it, in fact, so the path appears
already correct, but I had to discover
"C:\eclipse\plugins\org.apache.derby.core_10.2.2\derby.jar" from merely
"derby.jar" which wasn't found anywhere (or course).

It's been fun. If I find any more peculiarities, I'll be back here to
respond.

Russ Bateman
Re: Derby version and Eclipse version? [message #210579 is a reply to message #210570] Wed, 19 March 2008 00:40 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence Mandel
Messages: 486
Registered: July 2009
Senior Member
Thanks for posting your solution Russ. This will no doubt help others.

Lawrence Mandel
-
Co-author Eclipse Web Tools Platform: Developing Java Web Applications
http://www.eclipsewtp.org
Re: Derby version and Eclipse version? [message #210610 is a reply to message #210570] Thu, 20 March 2008 06:57 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

I'm still in trouble with the code inside Database.java stemming from
not being able to follow identically the steps in the tutorial (by
reason of running a much later version).

..
..
..
public String lookupFullname( String userid ) throws SQLException
{
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultset = null;
String fullname = "";
String DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
String URL
= "C:\\russ\\workspace\\Web Tools Platform\\Web1\\Web1db";
String QUERY
= "select fullname from WEB1.LOGIN where userid = ?";

try
{
Class.forName( DRIVER ); // fails here and is caught below...
connection = DriverManager.getConnection( URL );
statement = connection.prepareStatement( QUERY ); // erratum #1
statement.setString( 1, userid );
resultset = statement.executeQuery( QUERY );

if( resultset.next() )
fullname = resultset.getString( "FULLNAME" ).trim();
}
catch( Exception e )
{
e.printStackTrace(); // ends up here
}
..
..
..

I'm afraid installing Derby 10.3.2, then 10.2.2, etc. had left my
project without adequate an Derby driver. In an effort to repair this, I
used Build Path->Configure Build Path->Libraries->Add External JARs,
then navigated to c:\eclipse\plugins\org.apache.derby.core_10.2.2 to
find it, add it, then try again with no difference.

Then, I tried Connecting in the Data Source Explorer before launching in
debug mode. It went out to lunch permanently (didn't time out before I
typed this in) after typing in ryman, then clicking Login.

I'll keep rattling around and come back to say what I did to make it
work (if I figure it out).
Re: Derby version and Eclipse version? [message #210731 is a reply to message #210610] Sat, 22 March 2008 22:56 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Windofkeltia wrote:
> I'm still in trouble with the code inside Database.java stemming from
> not being able to follow identically the steps in the tutorial (by
> reason of running a much later version).
>
> .
> .
> .
> public String lookupFullname( String userid ) throws SQLException
> {
> Connection connection = null;
> PreparedStatement statement = null;
> ResultSet resultset = null;
> String fullname = "";
> String DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
> String URL = "C:\\russ\\workspace\\Web Tools Platform\\Web1\\Web1db";
> String QUERY = "select fullname from WEB1.LOGIN where userid = ?";
>
> try
> {
> Class.forName( DRIVER ); // fails here and is caught below...
> ...
> }
> catch( Exception e )
> {
> e.printStackTrace(); // ends up here
> }
> .
> .
> .

So, the problem remains that there is something wrong with DRIVER which
raises an exception caught further on. I've seen this path both in the
tutorial I'm trying to follow as well as on an IBM page.

If I'm following what is basically a HelloWorld tutorial, you can
imagine that I'm a beginner here. I am not yet able to understand why
the class isn't found after installing Derby 10.2, being able to connect
to the database, execute SQL statements against it, etc. I'm puzzled
that after being able to do that much, somehow the JDBC driver isn't
available and, while I can guess where the JAR containing it is in my
filesystem, I'm not certain what to do with it.

I sit at the foot of the mountain awaiting enlightenment (except that
I'm digging around a bit too and maybe I'll stumble upon the answer),
but I've been at this a few days now.

Russ Bateman
Re: Derby version and Eclipse version? [message #210750 is a reply to message #210731] Sun, 23 March 2008 16:58 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence Mandel
Messages: 486
Registered: July 2009
Senior Member
Hi Russ,

I usually see this type of error when the driver is not available on the
classpath. Did you copy derby.jar into your WEB-INF/lib directory as
stated in step 1 (p. 78)?

Also, if you haven't seen the book's errata, there is a correction for
this listing (for a line that I don't think you've hit yet). Take a look
at [1] for the details.

[1] http://eclipsewtp.org/errata.html

Lawrence Mandel
-
Co-author Eclipse Web Tools Platform: Developing Java Web Applications
http://www.eclipsewtp.org
Re: Derby version and Eclipse version? [message #210759 is a reply to message #210750] Mon, 24 March 2008 04:12 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

lmandel@ca.ibm.com wrote:
> Hi Russ,
>
> I usually see this type of error when the driver is not available on the
> classpath. Did you copy derby.jar into your WEB-INF/lib directory as
> stated in step 1 (p. 78)?
>
> Also, if you haven't seen the book's errata, there is a correction for
> this listing (for a line that I don't think you've hit yet). Take a look
> at [1] for the details.
>
> [1] http://eclipsewtp.org/errata.html
>
> Lawrence Mandel
> -
> Co-author Eclipse Web Tools Platform: Developing Java Web Applications
> http://www.eclipsewtp.org
>
Thank you. I thought that the JAR file being known under the plugin
directory and in the DTP interface where, elsewhere in this thread, I
show how I set it up, this would be enough. I will get the JAR file in
under WEB-INF.

Yes, I know of the errata and my Database.java file incorporated it as I
typed it in (I often choose to type in code rather than use the supplied
source for the pedagogical advantage it offers me, and yes, sometimes
that leads to an error, but not in this case).

Profuse thanks to you for again helping me.

Russ Bateman
Re: Derby version and Eclipse version? [message #210823 is a reply to message #210750] Mon, 24 March 2008 23:50 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

lmandel@ca.ibm.com wrote:
> Hi Russ,
>
> I usually see this type of error when the driver is not available on the
> classpath. Did you copy derby.jar into your WEB-INF/lib directory as
> stated in step 1 (p. 78)?
>
> Also, if you haven't seen the book's errata, there is a correction for
> this listing (for a line that I don't think you've hit yet). Take a look
> at [1] for the details.
>
> [1] http://eclipsewtp.org/errata.html
>
> Lawrence Mandel
> -
> Co-author Eclipse Web Tools Platform: Developing Java Web Applications
> http://www.eclipsewtp.org
>
Okay, just back to this...

It's true that I had somehow skipped instruction p. 78, #1. However,
even after copying
c:\eclipse\plugins\org.apache.derby.core_10.2.2\derby.jar to
c:\russ\workspace\Web Tools Platform\Web1\WebContent\WEB-INF\lib, I am
still not able to find the class. I tried playing with the Build Path...
stuff, but that didn't seem to help and the book instruction does say
(merely) to copy it. Of course, merely copying it, it doesn't actually
show up in either the Package Explorer or Navigator views:

java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1360)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1206)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.example.ch03.Database.lookupFullname(Database.java:30)
at org.example.ch03.HelloServletDB.doGet(HelloServletDB.java:40 )
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
at java.lang.Thread.run(Unknown Source)
Re: Derby version and Eclipse version? [message #210831 is a reply to message #210750] Tue, 25 March 2008 04:06 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

The saga continues: you kind of have to read the thread IN-ORDER to
understand where I've been and where I'm going. It also helps to consult
the tutorial in the book that I'm trying to get working from a much
later edition of Eclipse and a much later version of Derby.

This mildly embarrassing, but I'm persevering because I'm thinking of
the next guy coming behind me: if I'm of average intelligence then half
of the nube Eclipse/WTP/DTP community will encounter these same
problems? (Okay, so I may be below average, hehehe!)

This has been a mess to figure out. I think Eclipse could be a little
more helpful and I'm still not certain why it couldn't find various
classes and libraries. Little by little, I have solved some more problems.

First, copying derby.jar to the project (named Web1)
WebContent/WEB-INF/lib directory was insufficient. I also had to go to
Build Path->Configure Build Path->Libraries->Add External JARs, then
navigate to Web1/WebContent/WEB-INF/lib and add derby.jar explicitly.

Lesson learned: you must add the JAR file by hand. Copying it will not
work. I didn't try adding it from the original location where it was
installed (down under plugins) and not copying it to the lib subdirectory.

Second, the path to my database was c:\russ\workspace\Web Platform
Tools\Web1\Web1db. The spaces were a problem. I tried using %20 in place
of them, but this didn't work. Finally, I dropped Eclipse and renamed
the workarea to "wtp". I restarted, navigated to it and then had to hunt
all over the place inside Eclipse to rid myself of the original name.
This included the external JAR added above and at least one or two other
places.

Moral: do not use spaces in any pathname.

Third, the HelloServlet.class turned up missing. I had to go to Build
Path->Configure Build Path->Default output folder and Browse to
Web1/WebContent/WEB-INF/classes to ensure the class files for
HelloWorld.java and Database.java got put there. That wasn't enough and
I had to screw around with a lot of things before it finally worked. All
along, of course, I'm Cleaning the server and rePublishing, Cleaning the
project, etc. I wish I knew what I did to make this work.

Last, once HelloServlet began to run, the problem I figured would happen
all along arose: the select filename from userid SQL statement failed.
Now we were getting somewhere.

Moral? Uhhhh, beats me. Twiddle until you're frustrated and maybe it
will fix itself.

Only, unlike my installed MySQL database stuff (which I have not figured
out how to wire into Eclipse yet or we wouldn't even be talking about
Derby), I cannot figure out how to browse the database. I created an SQL
file with the statements to create the table and populate it with the
three author names (as instructed). Eclipse (or its authorized DTP
agent--it's kind of hard at this stage for me to tell what's what, but
Eclipse appears to be a huge symbiotic organism of plugins) told me it
had successfully executed these statements on my data base. Maybe I
misunderstood it. Anyway, adding the line

select FULLNAME from WEB1.LOGIN where USERID = 'ryman';

to this file (web1db.sql) open in its editor, selecting the line,
right-clicking and choosing Execute Selected Text produces the same
failure my Database.java code was getting. (All determinism in results
is a good thing.)

Opening the Data Source Explorer and examining the contents of web1db, I
see a world of crap--none of it recognizable or useful to me. I can't
find anything like a "table" or "WEB1.LOGIN". All I see is a subfolder,
SAMPLE, with Schemas, none of which I recognize as anything that
interests me--weird names like APP, NULLID, SYS, SYSCAT, SYSIBM, etc.
Notice the fields of the Connection profile (name and Database): You can
an illustration of all of this at the following URL:

http://www.windofkeltia.com/j2ee/tut-images/failing-user-db. jpg

Also, the SQL line just above the one shown getting executed fails too.

I'm certain this is just some low-level stupidity on my part.

However (!!!!!!!), if I select the whole SQL file and execute all the
lines, they all work against the database according the SQL Results pane
at the bottom of Eclipse. Even the two select lines. Is it just because
the effect creates a table with data then immediately performs the
select statements prior to the table disappearing (having only been
temporary)? Go figure why Database.java doesn't subsequently work.

See you in the succeeding installment. Until then, I'm still open to and
grateful for enlightenment.

Russ
Re: Derby version and Eclipse version? [message #210838 is a reply to message #210831] Tue, 25 March 2008 04:22 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Yes, I did try to play around underneath SAMPLE, creating tables by
hand, etc. They didn't "stick" and went away as soon as I created them.
Most of the time, they didn't stay around for any length of time. Once
when one did, I tried executing the INSERT statements, but to no avail.
Re: Derby version and Eclipse version? [message #210867 is a reply to message #210831] Tue, 25 March 2008 13:03 Go to previous message
Eclipse User
Originally posted by: sheremeta.greg.gmail.com

Russ,

Maybe try removing "WEB1" from all the statements? That's a schema I
believe, and you have no WEB1 schema in that picture.

I haven't used Derby in forever, but try this. Once you delete the WEB1,
the tables you create will show up under the schema of the person you
connected as. What username is that? Probably SA. So create your table,
refresh the schema list (click on schemas and hit F5 maybe, or maybe
disconnect and reconnect) and SA should show up. Your table will be
under there. All the other schemas can be ignored. They are used by
Derby for housekeeping, most likely.

Also, try adding "commit;" to the end of the script if it still doesn't
"stick".

Greg


Windofkeltia wrote:
> The saga continues: you kind of have to read the thread IN-ORDER to
> understand where I've been and where I'm going. It also helps to consult
> the tutorial in the book that I'm trying to get working from a much
> later edition of Eclipse and a much later version of Derby.
>
> This mildly embarrassing, but I'm persevering because I'm thinking of
> the next guy coming behind me: if I'm of average intelligence then half
> of the nube Eclipse/WTP/DTP community will encounter these same
> problems? (Okay, so I may be below average, hehehe!)
>
> This has been a mess to figure out. I think Eclipse could be a little
> more helpful and I'm still not certain why it couldn't find various
> classes and libraries. Little by little, I have solved some more problems.
>
> First, copying derby.jar to the project (named Web1)
> WebContent/WEB-INF/lib directory was insufficient. I also had to go to
> Build Path->Configure Build Path->Libraries->Add External JARs, then
> navigate to Web1/WebContent/WEB-INF/lib and add derby.jar explicitly.
>
> Lesson learned: you must add the JAR file by hand. Copying it will not
> work. I didn't try adding it from the original location where it was
> installed (down under plugins) and not copying it to the lib subdirectory.
>
> Second, the path to my database was c:\russ\workspace\Web Platform
> Tools\Web1\Web1db. The spaces were a problem. I tried using %20 in place
> of them, but this didn't work. Finally, I dropped Eclipse and renamed
> the workarea to "wtp". I restarted, navigated to it and then had to hunt
> all over the place inside Eclipse to rid myself of the original name.
> This included the external JAR added above and at least one or two other
> places.
>
> Moral: do not use spaces in any pathname.
>
> Third, the HelloServlet.class turned up missing. I had to go to Build
> Path->Configure Build Path->Default output folder and Browse to
> Web1/WebContent/WEB-INF/classes to ensure the class files for
> HelloWorld.java and Database.java got put there. That wasn't enough and
> I had to screw around with a lot of things before it finally worked. All
> along, of course, I'm Cleaning the server and rePublishing, Cleaning the
> project, etc. I wish I knew what I did to make this work.
>
> Last, once HelloServlet began to run, the problem I figured would happen
> all along arose: the select filename from userid SQL statement failed.
> Now we were getting somewhere.
>
> Moral? Uhhhh, beats me. Twiddle until you're frustrated and maybe it
> will fix itself.
>
> Only, unlike my installed MySQL database stuff (which I have not figured
> out how to wire into Eclipse yet or we wouldn't even be talking about
> Derby), I cannot figure out how to browse the database. I created an SQL
> file with the statements to create the table and populate it with the
> three author names (as instructed). Eclipse (or its authorized DTP
> agent--it's kind of hard at this stage for me to tell what's what, but
> Eclipse appears to be a huge symbiotic organism of plugins) told me it
> had successfully executed these statements on my data base. Maybe I
> misunderstood it. Anyway, adding the line
>
> select FULLNAME from WEB1.LOGIN where USERID = 'ryman';
>
> to this file (web1db.sql) open in its editor, selecting the line,
> right-clicking and choosing Execute Selected Text produces the same
> failure my Database.java code was getting. (All determinism in results
> is a good thing.)
>
> Opening the Data Source Explorer and examining the contents of web1db, I
> see a world of crap--none of it recognizable or useful to me. I can't
> find anything like a "table" or "WEB1.LOGIN". All I see is a subfolder,
> SAMPLE, with Schemas, none of which I recognize as anything that
> interests me--weird names like APP, NULLID, SYS, SYSCAT, SYSIBM, etc.
> Notice the fields of the Connection profile (name and Database): You can
> an illustration of all of this at the following URL:
>
> http://www.windofkeltia.com/j2ee/tut-images/failing-user-db. jpg
>
> Also, the SQL line just above the one shown getting executed fails too.
>
> I'm certain this is just some low-level stupidity on my part.
>
> However (!!!!!!!), if I select the whole SQL file and execute all the
> lines, they all work against the database according the SQL Results pane
> at the bottom of Eclipse. Even the two select lines. Is it just because
> the effect creates a table with data then immediately performs the
> select statements prior to the table disappearing (having only been
> temporary)? Go figure why Database.java doesn't subsequently work.
>
> See you in the succeeding installment. Until then, I'm still open to and
> grateful for enlightenment.
>
> Russ
Previous Topic:Sysdeo plugin: how to control which directories to pack up as .war file?
Next Topic:JSPs not compiling
Goto Forum:
  


Current Time: Wed Oct 22 23:15:36 GMT 2014

Powered by FUDForum. Page generated in 0.02357 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software