Todd Jaspers

Greenhorn
+ Follow
since Aug 29, 2005
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 Todd Jaspers

Thanks Annie, I appreciate it!
16 years ago

Originally posted by Bear Bibeault:
You can submit a static page containing your 3 fields, but you need to submit it to something. If you want it to be Java (as opposed to a CGI language like Perl), then a servlet is the answer.

The servlet can retrieve the three values, do whatever DB machinations that need to be done (or better yet delegate that task to UI-agnostic business objects), and then....

Well, that's where your explanation breaks down. In a web app, requests don;t return values (such as the boolean that you cited), they return responses. That is, the "next" web page.

So, your users are on a page with these three fields. They click the submit button and your DB magic happens. Then what? What do you want to happen at that point?





Thanks Bear, I appreciate the response in my emotional / dramatic state... hahah.

Basically, I'm making a payment posting page. Ultimately when everything is said and done, it will send an http request to a payment posting company with all the values in the URL.

Basically it will work like this:

1 - User goes to the payment posting page
2 - User enters in all the values in all the fields
3 - User clicks submit:
4 - Javascript activates and validates the fields to make sure they are not blank.
5 - If it passes the Javascript, I want it to then take three fields (account numbers for the patient).
6 - These three fields will be submitted to a database by means of a servlet (thanks)
7 - If the account number is valid, I was hoping it would somehow send a response back saying it was acceptable and asking the user to confirm (the confirm could be done with javascript on that page)
8 - If the account number was INVALID, I wanted it to popup saying it was invalid (maybe could also be done with javascript), and ask the user to re-enter the account number.

Does this sound possible?


Thanks Bear, I appreciate it.
16 years ago
Could someone explain to me exactly how this works?

Basically... I just want someone to be able to click a button on a web page.

This will take 3 fields, pass them to a Java application that will access a database, and then return a boolean value.

If the value is TRUE, then I want it to submit a string to a web site.


Is what I want to do a real difficult task? I've always been an applications programmer, and with that in mind, this seems like such a simple task, but I go to loads and loads of web pages that all seem to suggest that they have the answer, and I just get more and more confused. I understand how this all works, but damn... I'm getting really really frustrated. Can someone just piece this together for me?

If I write a JSP or a Servlet, does the web page have to be built "on the fly" by one of these? I will probably never update this page, so I could care less if it's static.

I just want to validate 3 fields from a database, that's ALL i want to do...


Thanks....
16 years ago
Ok, I need to accomplish the following:

I basically have this web page with a series of fields on it. The fields contain everything from the person's name, to his payment information.

When the user clicks the submit button, it activates Javascript.

The Javascript I have stored in a seperate JS file. Basically, all that it does is validate several fields JUST to make sure that they aren't blank.


From THIS point, is where I'm confused. Up to that point, everything works fine. Anyway, from this point, I want to be able to take THREE of the values from three of the fields, and query a database on the host. The host will then return a TRUE or FALSE value. I will then use the true / false value, and if it's TRUE, I will confirm with a message box.


Now, what should I use? I thought maybe an Applet woudl work, but apparently I can't use an applet for this??? Do I need to use a Servelet?

I'm totally confused.

Someone please steer me in the right direction.


Thanks,

Todd
16 years ago
Ok, I need to accomplish the following:

I basically have this web page with a series of fields on it. The fields contain everything from the person's name, to his payment information.

When the user clicks the submit button, it activates Javascript.

The Javascript I have stored in a seperate JS file. Basically, all that it does is validate several fields JUST to make sure that they aren't blank.


From THIS point, is where I'm confused. Up to that point, everything works fine. Anyway, from this point, I want to be able to take THREE of the values from three of the fields, and query a database on the host. The host will then return a TRUE or FALSE value. I will then use the true / false value, and if it's TRUE, I will confirm with a message box.


Now, what should I use? I thought maybe an Applet woudl work, but apparently I can't use an applet for this??? Do I need to use a Servelet?

I'm totally confused.

Someone please steer me in the right direction.


Thanks,

Todd
16 years ago
Hey guys,

Does anyone here know how to call a Java Applet from a Javascript function? I can't seem to find an example anywhere.


Thanks!

Todd
16 years ago
I've done this kind of thing with other languages as well..

for example, passing an array as a comma delimeted string from a DLL to a VB scripting language. This idea works pretty well...
16 years ago
Thanks Norm! I appreciate it.

Is there a place where I can find all the different methodes and properties available to me with this OOP language?


Thanks!
16 years ago
Hey guys,

I'm not really sure where exactly I can look for this. But, I've got payment posting page that I've written in HTML. I've added some Javascript to validate that the required fields aren't blank.

After the Javascript runs, I would like to call an applet.

I have a skeleton of a Java Application that I've been writing (with the help of the guys in the beginner forum) in Eclipse. This application accesses an MS SQL database and will validate a couple of fields from the web page that I pass to it (currently those values are hard coded on the application).

I'd like to convert this to an applet, and one of the things I am having difficulty finding is a method to create a pop-up.

I would like for the applet to create a popup, with a YES or NO button on it. Does anyone have a simple example of an applet such as this?


Thanks for any help you guys can provide. I checked the code barn, but I didn't see anything.


Thanks!
16 years ago

Originally posted by Tom Blough:
Todd,

Did you set up idxAnalyzerCustom as a user or system data source? If you use that form you need to configure an ODBC datasouce on your machine with that name. For MS Access you can use the alternative URL for the getConnection method that specifies the file/path to the .mdb file that I wrote about.

Java is also case sensitive. sun.jdbc.odbc.JdbcOdbcDriver is not the same as sun.jdbc.odbc.jdbcodbcdriver. The former is correct.

Tom



Damn! That must be it then...

I did: "sun.jdbc.odbc.jdbcodbcdriver"

Yeah, I already have an ODBC set up with that exact name. "idxCustomAnalyzer".


Thanks everyone for all the help, I really appreciate it.

I'm used to Delphi and Visual Basic, neither of which care very much for the case of the variables and whatnot.

This is very similar to Mumps with respect to case sensitivity.


Thanks!!!
16 years ago
Hey Max, I hope this isn't too stupid of a question....

But I'm getting an error when it attempts to load the database driver.

I downloaded the JTDS JDBC driver, but I'm unsure of where to put it, or how exactly I should define where it is...

The error I get is:




The variables that I've defined look like this:




when it says net.sourceforge.jtds.jdbc.Driver, how can I define this to Java? I noticed there is a Class Path file in the root of the project, can I manipulate that file?

I really apologize for asking this quesiton when it's probably something I should know before I even get to this level...

I guess my question is:

1 - Where do I put the JTDS Jar
2 - Where do I include / define to my project that I've put it somwhere.




Again, thank you SOOO much for the time you've taken to help me, I REALLY REALLY appreciate it.

Originally posted by Tom Blough:
Todd,

One thing I should point out is all the "magic numbers" in columnNames.getString() methods. Those are documented in the Java API for DatabaseMetaData.getColumns().

Have fun,



Hey Tom, one quick question,

it does error out when it attempts to connect to the database...


for the ODBC / PATH string, I have:



I also include java.sql.*;

Is there anything that I am missing that I should have done?

The error I get is:

"Error connecting to PO Database
java.lang.ClassNotFoundException: sun.jdbc.odbc.jdbcodbcdriver"


Thanks!!

Todd
16 years ago
Thank you Tom, I really appreciate it!!!
16 years ago

Originally posted by Maximilian Stocker:
All right here we go...

Now a few notes. This program uses the Jtds driver. So if you want to use yours you need to make the appropriate changes including your class path.

The database I used is SQL Server although that doesn't matter... what is important is that I created a table called tblTest with three fields. An autoincrementing int field that is my primary key called id and two varchar fields called firstname and last name.

To compile this program all you need to do is

javac DBTest.java

To run the program as is you would do

java -classpath .;jtds-0.9.jar DBTest

In my case my jar is in the directory with the program but you can make the neccessary modifications. There are plenty of comments but essentially you will need to change the connection variables and if you use a different driver than change the class name and class path as needed.




Hey, I REALLY appreciate this... thank you very much... this will be extremely helpful. I appreciate you taking the time and writing this for me...

"Todd J.",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.



Sorry about that, I'm usually weird about putting my full name on the internet. But I've corrected it.



Thanks,

Todd