473,387 Members | 1,899 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,387 software developers and data experts.

Köll & Sam Classroom Blog

Dököll
2,364 Expert 2GB
Hello Dudes and Dudettes!

I am excited to announce I am embarking on a new Journey, JAVA baby. This is a new arena for me, hope I survive and able to muscle through it.

Will post articles within three months from now.

Wish me luck!

Köll
Sep 5 '07
216 13944
Dököll
2,364 Expert 2GB
Greetings, Jos!

Thanks for replying... Below was an attempt to increment columns each time the program reads database columns and found addtional columns next marker, loops until there are none, I am probably reading it wrong:-)

Expand|Select|Wrap|Line Numbers
  1.  
  2. for(int i=1; i<columnCount+1; i++) {
  3.     resultsMetaData.getColumnName(i);
  4.     }
  5.  
  6.  
But to answer your question, the code runs fine and fires a .jsp file, but when I run program using the actual code above, MetaData seems to be an issue.

I'll look at te loop again, and post the error.

Hey, have a good Friday...

In a bit!

Dököll
I'll just add it now Jos, will try the loop later and will yu know:
Expand|Select|Wrap|Line Numbers
  1.  
  2.     at HelloWorld.showTable(HelloWorld.java:64)
  3.     at HelloWorld.doGet(HelloWorld.java:48)
  4.     at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  5.     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  6.     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  7.     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  8.     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  9.     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  10.     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  11.     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  12.     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  13.     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
  14.     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  15.     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
  16.     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  17.     at java.lang.Thread.run(Unknown Source)
  18.  
  19.  
Jun 6 '08 #201
JosAH
11,448 Expert 8TB
The getColumnName(int i) method simply returns the name of column i;
your loop retrieves them all and simply ignores them. You could've taken that
entire loop out of your program because all it does is consuming a bit of time.
Read the API documentation for the ResultSetMetaData class.

kind regards,

Jos
Jun 6 '08 #202
Dököll
2,364 Expert 2GB
The getColumnName(int i) method simply returns the name of column i;
your loop retrieves them all and simply ignores them. You could've taken that
entire loop out of your program because all it does is consuming a bit of time.
Read the API documentation for the ResultSetMetaData class.

kind regards,

Jos
Unbelievable, making more work for myself, thanks for pointing out API documentation for the ResultSetMetaData class, keep you posted.

Köll
Jun 7 '08 #203
JosAH
11,448 Expert 8TB
Unbelievable, making more work for myself, thanks for pointing out API documentation for the ResultSetMetaData class, keep you posted.

Köll
AAMOF *all* the classes you can use in Java SE are (heavily) documented. See
the Articles Index in the Java 'Howtos' section for a link from where you can
download the entire documentation; it's only a couple of mega bytes. Always
check the docs first for any class you want to use no matter whether or not you
think you already know that class; it pays back big times if you do so.

If you don't you might end up as lots of others who think the entire programming
world should be visual basic and be surprised again and again that Java doesn't
have a ClearScreen command or something else silly.

kind regards,

Jos
Jun 7 '08 #204
Dököll
2,364 Expert 2GB
Works like a charm, the API documenatation for both Database and ResultSet helped a great deal, the loop has since been reconsructed, I think I would have had issues beyond the API info:
Expand|Select|Wrap|Line Numbers
  1.  
  2.     for (int i = 1; i <= colCount; ++i) {
  3.           out.println("<th>" + resultSetMetaData.getColumnName(i) + "</th>");     
  4.           out.println("</tr>");
  5.    while (resultSet.next()) {
  6.           out.println("<tr>");
  7.    for (int i = 1; i <= colCount; ++i)
  8.           out.println("<td>" + resultSet.getString(i) + "</td>");
  9.           out.println("</tr>");
  10.             }
  11.  
  12.  
Thanks a million for your help Jos...

We'll see you in a bit, I have a couple of question, I must fetch it from an email...
Jun 7 '08 #205
Dököll
2,364 Expert 2GB
Hello again!

In crystal reports, one can drag fields onto reports. Fields can be text,
date time, numbers, etc. I know they support html. I need to know if they
support all the html tags(eg: bgcolor, tables, etc).

Also, can you point me to a turtorial for calling Crystal reports from Java servlets
using simple java classes to provide data, I can't seem to find a sound document, an easy to understand one to follow, perhaps it cannot be done.

Would you know if integrating the Crystal reports viewer with an
application server like websphere/tomcat is doable?

Will keep searching meanwhile and will post my findings.

In a bit!

Dököll
Jun 7 '08 #206
JosAH
11,448 Expert 8TB
Works like a charm, the API documenatation for both Database and ResultSet helped a great deal, the loop has since been reconsructed, I think I would have had issues beyond the API info:
Expand|Select|Wrap|Line Numbers
  1.  
  2.     for (int i = 1; i <= colCount; ++i) {
  3.           out.println("<th>" + resultSetMetaData.getColumnName(i) + "</th>");     
  4.           out.println("</tr>");
  5.    while (resultSet.next()) {
  6.           out.println("<tr>");
  7.    for (int i = 1; i <= colCount; ++i)
  8.           out.println("<td>" + resultSet.getString(i) + "</td>");
  9.           out.println("</tr>");
  10.             }
  11.  
  12.  
Thanks a million for your help Jos...
You're welcome of course; but what would you do if that ResultSet contains, say,
1,000,000 rows or so?

kind regards,

Jos
Jun 7 '08 #207
JosAH
11,448 Expert 8TB
Hello again!

In crystal reports, one can drag fields onto reports. Fields can be text,
date time, numbers, etc. I know they support html. I need to know if they
support all the html tags(eg: bgcolor, tables, etc).
If Crystal Reports is Java (and I think it is) the following from the API docs apply:

The Swing JEditorPane text component supports different kinds of content via a plug-in mechanism called an EditorKit. Because HTML is a very popular format of content, some support is provided by default. The default support is provided by this class, which supports HTML version 3.2 (with some extensions), and is migrating toward version 4.0. The <applet> tag is not supported, but some support is provided for the <object> tag.

Also, can you point me to a turtorial for calling Crystal reports from Java servlets
using simple java classes to provide data, I can't seem to find a sound document, an easy to understand one to follow, perhaps it cannot be done.

Would you know if integrating the Crystal reports viewer with an
application server like websphere/tomcat is doable?
I'd have to google for that but I don't assume you live in a googleless area :-)

kind regards,

Jos
Jun 7 '08 #208
Dököll
2,364 Expert 2GB
If Crystal Reports is Java (and I think it is) the following from the API docs apply:






I'd have to google for that but I don't assume you live in a googleless area :-)

kind regards,

Jos
Oh no, Google's our friend, it's surely out there, thanks for your input... Just wondered if you had an idea, thanks for replying:-)

Getting an error though, I was coming over to bug you again:

Server Tomcat v6.0 Server at localhost failed to start.

Did I do something weird, it worked flawlessly before, well at least to some degree, if you remember the last post Jos... I must have done something to it, it's just not firing. Any ideas, googling it momentarily (does not seem to be coming up for me though)... probably beat you to it...hope some posted something:-)

Again thanks for your help...
Jun 9 '08 #209
Dököll
2,364 Expert 2GB
Oh no, Google's our friend, it's surely out there, thanks for your input... Just wondered if you had an idea, thanks for replying:-)

Getting an error though, I was coming over to bug you again:

Server Tomcat v6.0 Server at localhost failed to start.

Did I do something weird, it worked flawlessly before, well at least to some degree, if you remember the last post Jos... I must have done something to it, it's just not firing. Any ideas, googling it momentarily (does not seem to be coming up for me though)... probably beat you to it...hope some posted something:-)

Again thanks for your help...
I was fooling around with one of my xml files... all is well now...

This one's for the newbies, if you have this problem, look at your log file for Tomcat: C :\ Program Files\Apache Software Foundation...\...logs, it'll tell you where the problem is...

Later,

Dököll
Jun 10 '08 #210
JosAH
11,448 Expert 8TB
I was fooling around with one of my xml files... all is well now...

This one's for the newbies, if you have this problem, look at your log file for Tomcat: C :\ Program Files\Apache Software Foundation...\...logs, it'll tell you where the problem is...

Later,

Dököll
There's an entire chapter devoted to logging in Tomcat's documentation;
everybody can find the details there.

kind regards,

Jos
Jun 10 '08 #211
Dököll
2,364 Expert 2GB
There's an entire chapter devoted to logging in Tomcat's documentation;
everybody can find the details there.

kind regards,

Jos
Yes, I started reading, not about logging in Tomcat, but of file transfers from system to system, and lo and behold my system at home has all the old stuff and does not play nice with stuff at work.

For now I'll simply recreate stuff, when I get any bright ideas away from work, I send them there via email. But will definitely check into the tomat doc, there aere things I was able to do, like simply firing form my browser that I cannot do, will give it a shot.

I have started using NetBeans and Eclipse, side by side, just to see what the real differences are, NetBeans seems to be winning:-)

In a bit, really it's the way that NetBeans builds JSF pages seamlessly, thus far... will try to post problems side by side...
Jun 27 '08 #212
Dököll
2,364 Expert 2GB
I have started using NetBeans and Eclipse, side by side, just to see what the real differences are, NetBeans seems to be winning:-)

In a bit, really it's the way that NetBeans builds JSF pages seamlessly, thus far... will try to post problems side by side...
Alright!

Here's the scoop, I have either lost my marbles or something else but for the past couple of days I have been trying to find libraries specific to below, to no avail:

Expand|Select|Wrap|Line Numbers
  1. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  3.  
import javax.faces.*; is not legal...

Where are these libraries stored?

NetBeans is having the same issues firing JSF, I suspect JSF is handled differently, so the seamless find was seeminglya NetBeans-specific engine that fires JSFs, at least that's what I think is happening, nonetheless, no joy there, it may mean no fooling around differentl IDEs and expext likely results...

Do such tag libraries exist, they must but I am blind thus far:

Expand|Select|Wrap|Line Numbers
  1. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  3.  
Jun 29 '08 #213
Dököll
2,364 Expert 2GB
Alright!

Here's the scoop, I have either lost my marbles or something else but for the past couple of days I have been trying to find libraries specific to below, to no avail:

Expand|Select|Wrap|Line Numbers
  1. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  3.  
import javax.faces.*; is not legal...

Where are these libraries stored?

NetBeans is having the same issues firing JSF, I suspect JSF is handled differently, so the seamless find was seeminglya NetBeans-specific engine that fires JSFs, at least that's what I think is happening, nonetheless, no joy there, it may mean no fooling around differentl IDEs and expext likely results...

Do such tag libraries exist, they must but I am blind thus far:

Expand|Select|Wrap|Line Numbers
  1. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  3.  
I was searching wrong:

http://java.sun.com/javaee/javaserve...ocs/index.html I think I'll find what I need here, stop me if this is the wrong area. This latest search was my bgest shot. Thanks in advance:-)
Jun 29 '08 #214
Dököll
2,364 Expert 2GB
I was searching wrong:

http://java.sun.com/javaee/javaserve...ocs/index.html I think I'll find what I need here, stop me if this is the wrong area. This latest search was my bgest shot. Thanks in advance:-)
1 of 2 resolved; now, even though I am no longer having a build error, the page did not load, what do you make of it? I will be installing rational to just have everything installed at once, but how does one fix this if running Eclipse...

Expand|Select|Wrap|Line Numbers
  1.  
  2. Project name:
  3. Group name:
  4. Programming:
  5. Date:
  6. Owner:
  7. Legal:
  8.  
  9.  
  10. <%@ page contentType="text/html"%>
  11.  
  12. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
  13. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
  14.  
  15. <f:view>
  16.     <html>
  17.     <head>
  18.                 <title>Employee Login</title>
  19.                 </head>        
  20.     <body>
  21.     <h:form>
  22.     <table>
  23.     <tr>
  24.     <td>
  25.                  <h:outputText value="Please add Office ID: " />
  26.                 </td>
  27. <td><h:inputText id="loginspecificid" value="#{LoginEmpOfficeID.loginspecificid}" /></td>
  28.     </tr>
  29.                 <tr>                        <td><h:outputText value="Please your Employee ID: " /></td>
  30. <td><h:inputSecret id="employeeid" value="#{LoginEmpOfficeID.employeeid}" /></td>
  31.                 </tr>
  32.     <tr>
  33.     <td>&nbsp;</td>
  34. <td><h:commandButton value="Login" action="#{LoginEmpOfficeID.CheckMate}" /></td>
  35.     </tr>
  36.     </table>
  37.     </h:form>
  38.     </body>
  39.    </html>
  40. </f:view>
  41.  
I get an HTTP ERROR: 200, clearing unhappy with something, what's the deal there?

By the way, another way remedying the previous problem I had (not having the proper lib being called!) is to simply load Eclipse Ganymede which comes complete with reports abilities no Birt but also adds further functionality with Sun's JSF lib access. Hope this helps anyone having just that part of the problem...

Any help you can procide with the above HTTP ERROR: 200 glitch is helpful, even though I may fix this with proper software installed, it's food for brain, I think... good for others who wish to fix Eclipse - Europa/Ganymede problems also.

Thanks again good people!

Dököll
Jun 29 '08 #215
Dököll
2,364 Expert 2GB
1 of 2 resolved; now, even though I am no longer having a build error, the page did not load, what do you make of it? I will be installing rational to just have everything installed at once, but how does one fix this if running Eclipse...

Expand|Select|Wrap|Line Numbers
  1.  
  2. Project name:
  3. Group name:
  4. Programming:
  5. Date:
  6. Owner:
  7. Legal:
  8.  
  9.  
  10. <%@ page contentType="text/html"%>
  11.  
  12. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
  13. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
  14.  
  15. <f:view>
  16.     <html>
  17.     <head>
  18.                 <title>Employee Login</title>
  19.                 </head>        
  20.     <body>
  21.     <h:form>
  22.     <table>
  23.     <tr>
  24.     <td>
  25.                  <h:outputText value="Please add Office ID: " />
  26.                 </td>
  27. <td><h:inputText id="loginspecificid" value="#{LoginEmpOfficeID.loginspecificid}" /></td>
  28.     </tr>
  29.                 <tr>                        <td><h:outputText value="Please your Employee ID: " /></td>
  30. <td><h:inputSecret id="employeeid" value="#{LoginEmpOfficeID.employeeid}" /></td>
  31.                 </tr>
  32.     <tr>
  33.     <td>&nbsp;</td>
  34. <td><h:commandButton value="Login" action="#{LoginEmpOfficeID.CheckMate}" /></td>
  35.     </tr>
  36.     </table>
  37.     </h:form>
  38.     </body>
  39.    </html>
  40. </f:view>
  41.  
I get an HTTP ERROR: 200, clearing unhappy with something, what's the deal there?

By the way, another way remedying the previous problem I had (not having the proper lib being called!) is to simply load Eclipse Ganymede which comes complete with reports abilities no Birt but also adds further functionality with Sun's JSF lib access. Hope this helps anyone having just that part of the problem...

Any help you can procide with the above HTTP ERROR: 200 glitch is helpful, even though I may fix this with proper software installed, it's food for brain, I think... good for others who wish to fix Eclipse - Europa/Ganymede problems also.

Thanks again good people!

Dököll
I guess you could say I am close, but no cigar yet...

As it turns out, rational comes complete with the proper packages/utils, whereas Eclipse needs certain jars added to see added packages:

(1) jsf api/imp jar files
(2) jstl jar file
(3) Others, depending on what you are doing

Without these jar files, you will not be able to load JSP/JSF form-specific tags, essential to firing JSF-enabled pages and reap the benefits of good descent web sites:-)
Jul 8 '08 #216
Dököll
2,364 Expert 2GB
I guess you could say I am close, but no cigar yet...

As it turns out, rational comes complete with the proper packages/utils, whereas Eclipse needs certain jars added to see added packages:

(1) jsf api/imp jar files
(2) jstl jar file
(3) Others, depending on what you are doing

Without these jar files, you will not be able to load JSP/JSF form-specific tags, essential to firing JSF-enabled pages and reap the benefits of good descent web sites:-)
The jar files did the trick, no longer having a problem:-)
Jul 12 '08 #217

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

Similar topics

65
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++...
6
by: Rich Wallace | last post by:
All, I receive an xml doc with an element which contains a &amp; in the data. I am attempting to insert the data into a SQL Server database and I want to convert the &amp; to a "&" character before I...
5
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
1
by: Vijay | last post by:
CSQA & CSTE Prep Courses for International Certifications by QAI,USA @Hyderabad After receiving overwhelming response to our last 50+ batches, SpectraMindSolutions.com now announces a new...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
3
by: Tony | last post by:
I see that many pages have &amp; in querystring instead &. What is difference? Can I put page link (url) www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write...
71
by: iesvs | last post by:
Hello guys, every time a rode a doc or a book about the language C I saw that operators << and >exist. But each time they said that << translate the digit to the left (and >...) but no one said if...
0
by: delhi institute of management & services | last post by:
Delhi Institute of Management & Services Dear friends, We are extremely happy to welcome you to the world of Management... We are in the process of preparing some 5 minutes revision Q & A type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.