Dave Soto

Ranch Hand
+ Follow
since Sep 15, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dave Soto

I'm running Tomcat 3.3 and I'm trying to connect to an SMTP server with JavaMail. The machine that is running Tomcat 3.3 has J2SE1.3 and J2EE1.3. So, JavaMail is included with the J2EE. Now, according to my documentation, in order to give Tomcat visibility to any jars that aren't part of JAVA_HOME, you need to copy them to %TOMCAT_HOME%/lib/common,
./lib/apps, ./lib/containter, or webapps/--WEBAPP--/WEB-INF/lib. I wanted to make the JavaMail stuff visible to all my webapps, so it seemed I should copy the j2ee.jar file into ./lib/apps.
Well, once I did that, I no longer got any import errors. However, I keep getting the following error in the page where I am attempting to send the email, and it's obnoxious. Just to clarify, I am NOT calling flushBuffer().

If anyone can help out, I'd be extremely appreceiative.
22 years ago
You can CALL a stored procedure with JDBC, but you cannot CREATE one. Each DBMS has its own syntax for creating stored procedures, and the current JDBC spec does not handle this. You have to look into the syntax for the particular DBMS you are running.
Once you've created the stored procedure on the DBMS, calling it from a JDBC statement is pretty simple. (This example is VERY simplified, it assumes the stored procedure has no arguments)

The most important thing to notice is that it uses the {call ...} escape sequence. This instructs the JDBC driver to translate this sequence into the native command for your particular DBMS.
The SQL standard defines set operations UNION, EXCEPT, and INTERSECT. For some odd reason, Oracle departs from this syntax by replacing EXCEPT with MINUS. MINUS behaves exactly as you would expect EXCEPT to behave. Here is my problem:
I was hoping that I could use EXCEPT in my JDBC statements, and that somehow the JDBC driver would know to replace my EXCEPT with a MINUS before querying the database. Instead, the only way it works is if I use MINUS in my JDBC statements.
This is very undesireable, as we occasionally may use a different database. Up to this point all other statements have translated nicely.
Is there a JDBC escape sequence, or some other way to accomplish a database-independent way of performing the EXCEPT set operation? Thanks.
Thanks very much for the getTime() recommendation. That works wonderfully.
Thank you so much! Since both java.util.Date and java.sql.Date have a constructor that accepts milliseconds, and they both have the getTime() method that returns milliseconds, then that is the key to freely creating one from the other. It was staring me in the face the whole time. Thanks for your help.
22 years ago
Your code section is empty... try posting again.
22 years ago
Whoa... I found another problem that you're going to have a hard time overcoming... DJGPP is a C++ compiler. You can't compile java programs with a C++ compiler. So, unless I missed something, you probably need to start off by downloading the JDK from Sun's website.
http://java.sun.com/j2se/1.3/
Good luck!
22 years ago
This is a quote from the DJGPP website:
If you ... want to obtain a version of DJGPP that fully works on Windows 2000/XP then please go away as it is not stable enough for a novice or learner to use yet on Windows 2000/XP.
Sounds like you might want to consider using something other than DJGPP if you need to be running Win2000.
22 years ago
You've got two requirements:
1) I need to pass each parameter for my app to work.
2) I need some parameters to be null sometimes.
These two requirements are mutually exclusive.
You need to fix your app so that it can handle null parameters. You can never guarantee that a user will behave himself... for instance, even if you have some client-side validation, a naughty user can modify the page on his side and get around your client-side stuff.
So before you ever attempt to use a parameter, test to see if it's null first. Then you won't get a nullpointer exception. If you absolutely needed that parameter for something, and it's tests null, then send the user off to an error page.
22 years ago
I have read various recommendations for DateFormat and SimpleDateFormat when dealing with JDBC and java.sql.Date. However, none of the methods in DateFormat or SimpleDateFormat seem to accept or return a java.sql.Date. Instead, they use a java.util.Date. So:
1) How does one work with a java.sql.Date in DateFormat and SimpleDateFormat?
2) Is there a simple way to convert between java.util.Date and java.sql.Date?
22 years ago


Why is it so ?


'Cuz Tomcat is FREE!
If you need hot deploy try Weblogic(Unmistakably NOT Free)
22 years ago
Um, why would you need to distribute the compiler?
If you are selling software written in JSP, well, your customers need a JSP/Servlet engine to deploy on, right? Every Servlet engine that I am aware of is distributed with an appropriate compiler and automatically compiles the JSPs you provide according to your XML deployment descriptors... In fact, I'm relatively certain that this is a REQUIREMENT of the JSP/Servlet specification.
So, why worry about distribution of the compiler?
[This message has been edited by Dave Soto (edited October 01, 2001).]
22 years ago
Let's all chant together...
JDBC... JDBC... JDBC... JDBC...
22 years ago
This sounds like it's probably a simple one, but you'll need to post your code if you want us to be able to fix it.
22 years ago
Right... HTTP does NOT establish persistent connections, so the question "How many users are currently connected?" can have more than a couple interpretations...
22 years ago