Linda Thomas

Greenhorn
+ Follow
since Aug 12, 2004
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 Linda Thomas

We are having a debate regarding how a phone number should be saved in the database. The program we are testing is saving the phone number with dashes (i.e. 123-456-7890). I argue that we should not be putting dashes into the database for a phone number.

What would the standard be for most professional databases?
I tested the Oracle9iAS Containers for J2EE by typing http://127.0.0.1:8888 in a browser and got that page to display. When I try another page (like the ones included on the student data cd) the browser shuts down so fast I can't see what's happening on the browser (if there is an error or something).

I've read that I should try stopping IIS Admin Service and antivirus service and start OracleService, OracleSuitesTNSListener, and OracleiSuitesHTTPServer (typo?) then OC4J Instance. I haven't figured out if I go through Control Panel > Administration > Services (most say Services is on Control Panel but I have to go one deeper into Admin to find it) or if I turn them on like I do the OC4J Instance. The teacher has no idea at this point. He says he loaded it up the same way it is spelled out in the documentation Oracle provides to install the PE and its working on his machine. I don't know if he has IIS running though, it is on my computer. I've uninstalled and reinstalled Oracle 3x to no avail. I've followed the instructions step by step on my desktop as I installed on my laptop.

I know that I'm not getting the ListenerServer init() line showing up when I run a form. This shows up on the school computers which work but not on my laptop.
19 years ago
I got the PE of Oracle that came with my textbook and installed it including the Developer Suite on my laptop. My teacher has been unable to help me resolve the problems I've encountered trying to run forms. First I had issues with SERVICE_NAME but I managed to get it to let me login with the correct database name. Now when I try to run a form the browser opens up and then immediately shuts down. I checked my Start OC4J console with the one working on the destops at school and I am missing one line:

FormsServlet init():
configFileName: c:\oradev92/forms90/server/formsweb.cfg
testMode: false
ListenerServlet init()

I am missing the last line, ListenerServlet init(). These 4 lines only appear in the console window after I run a form, not when OC4J is started.

I have gone into the Preferences and set the browser to IE's .exe file because I was getting http://%20%20 infront of the url.

Teacher has no clue, can anyone help me get this running?
19 years ago
Thanks for replying!! I feel so much better!

There was definitely a learning curve and I know this project has been delayed as a result of me incorporating the beans but I have always felt that the effort was worth it. I have been coming in weekends and nights and even working on code at home because I felt so strongly about it. Then he critisized the code yesterday and I dropped rock bottom and came in today not caring about the project.

I do believe it has to do with code as well but not the beans. I think it has something to do with the connections. I looked and the connections are being released rather than closed.
finally
{
try
{
pool.releaseConnection( con );// release the connection
} catch( Exception ce )
{
System.err.println( "Connection Release Exception: " + ce.getMessage( ) );
}
}

When the new guy started he remembers, as do I, the webmaster coming in complaining that connections weren't being properly closed, related to result sets and statements, and stressed the importance of us closing all down when we are finished.

What I am wondering is, the CallableStatments (cstmt) are used throughout all of our programs. We have about 10-12 programs that can be accessed at anytime by those authorized to do so. The folder structure is webapps/name/ where name is whatever directory he's using at the time (we have 3 main areas where a program can be placed on server and we recreate the structure on our C drive.

Under name is admin (for administrative sides to a program), web for public side of a program, source where our .java files are and WEB-INF for where our compiled classes go.

Under the source its source/edu/name/ then admin, web, connectionpool, util and control. So every admin and web program is using the same connectionpool files. I was wondering if there might be an accumulative effect of multiple programs trying to access the same connection files? For me running on my standalone machine its not a problem but the live programs may have multiple users accessing multiple programs. Since I am running standalone do standalone programs and live programs have an accumulative effect on the server? Its all going to the same server. Is this a possibility?

Thanks again for replying! I feel so much better! This is the second solo project I've done and I look back at my first one and think how much more efficient and elegant I could have made the code and I really wanted to do this one proud!
19 years ago
JSP
I've been working with beans and I love them but I've gotten some issues lately and so I want to fully understand what is going on with the beans and how they work.

When I create a bean on my JSP page where is the bean? Is it hanging in RAM? How reliable is the information? How long does the bean exist? I have it set to session scope and I access the bean in the header file so for each and every page I access that bean. Is it possible to lose the information somehow? (besides the session timing out when the user hasn't used it in 30 mins)

How does a bean compare to a session variable? They seem to have the same function to me, both being persistant information I can access at any page of my project, but beans are more powerful. Session variables are objects and require casting to insert integers.

Should I set the bean as application scope?
ClientBean newBean = ( ClientBean )session.getAttribute( "tempclientbean" ); Is how I am accessing the bean in a class file where we do all our stored procedures and other database features. I tried to switch to the application scope but that session.getAttribute won't work. I think I need to access application beans differently but I don't know.
19 years ago
JSP
My javabeans are set to session scope, should they be set to application scope? I tried that but when I tried to do ClientBean newBean = ( ClientBean )session.getAttribute( "clientbean" ); I would get an error. Should it be application.getAttribute? I think I tried that and it didnt' work either.
19 years ago
JSP
Thanks for the welcome I've surfed around here a bit but haven't participated up til now.

Well the set up we have for projects is that the students (I myself being one) code the JSP pages. The webmaster has made 3 class files: ConnectionPool.java, PooledConnection.java and Connection.java. These 3 classes work to create the connection to the database.

We have sort of a base template we use for our projects. Like News program had New.java. It creates a vector ResultSet and an Object ResultSet then has an execute ("public void execute( HttpServletRequest request,HttpServletResponse response, ServletContext context ) throws Exception"). Inside here is:
// Get a database connection from connection pool -- POOL
ConnectionPool pool = ( ConnectionPool )context.getAttribute( "POOL" );
Connection con = pool.getConnection();

// create HTTP session
HttpSession session = request.getSession();

After this we have a try and catch set up. Within the try is where we students work. The rest of the code is all set up and we just copy an old file and alter the try. Within here we request a mode from our page and then we test for it. So my project has if (mode.equals(addclient)).

Within the if/else if statments we can create a CallableStatement if we have a stored procedure or we use a Statement until the stored procedure can be created for us. It is pretty simple for us to create a project but we have no real idea what's going on in the java files he's made to see if the connections are all being closed properly.

One thing we do though is if we produce a listbox, we make a seperate .jsp page and connect through there. The webmaster came to us a couple months back and told us to make sure we were closing everything off properly, that some sockets or connections weren't closing properly. There is a language barrier and its very difficult to get some standards set up because he seems to change his mind with different students and different projects (like one guy now is not using those 3 java connection files, he's doing all his connections directly with no stored procedures). But I want to be sure I'm closing everything so I want to check here, which of these need to be manually closed?

ResultSet rs with rs.close();
Statement stmt with stmt.close();
CallableStatement cstmt with cstmt.close();

We do the first two but I am wondering if we need to close the CallableStatement (which I have never done or seen done in any of our projects).

In my beans I am only importing the following:

package edu.admin.services;

import java.sql.*;
import java.util.*;
import java.lang.*;

There is no direct connection to the database, nothing to do with the database at all. All it is is properties with gets and sets, one that reinitializes everything to 0 or "" and one that takes the object search_results generated from the database class file (Clients.java, News.java, PhoneBook.java, etc) and sets all the properties.

Now in my Clients.java file I am importing import edu.admin.services.ClientBean;
and using ClientBean newBean = ( ClientBean )session.getAttribute( "clientbean" ); to access the information I have stored in my bean, could this be a problem?

Honestly I love working with the beans. My clients have close to 50 properties that are viewed and updated across multiple pages within my project. We have had problems with special characters being passed between pages, especially through URLs, and to the database. We've had to create huge functions to replace any special character we can think of, resorting to replacing & with AMP; and other ugly messy handling functions. When looking into the database if we didn't use these functions all the special characters were stored as ? but the database took the special characters in a bean and saved em just like they were, ie @#$%^&*!. No problem.

I am very reluctant to remove the beans. I've been able to take 6 pages of code to add a client and reduce it to 3. I've been able to seperate interface from business logic. There is no way I could explain that to my supervisor in a way he would understand. But since I'm the only one in the office who's ever worked with beans I have no clue as to some of the issues that they can cause in development.

Are there any problems with beans? Are they less reliable than session variables? Is there a way they can easily lose their information? My user logins in and creates a bean and if the bean dies in the middle of the program the user's screwed and so am I. Is there anything to do with beans that I am unaware of?

P.S. Thanks for replying Jules! It was terribly frustrating today when we demo'd for over an hour with my code working perfectly before socket errors made it crap out. Then the guy says its my code but it was fine and we saw those pages load within the that demo. He said my code is unreliable and he blames the beans yet I brought him 6 pages of tomcat screenshots showing him the socket errors. He still thinks its my code
19 years ago
JSP
I am the first in our office to implement javabeans into a project. Normally we just access the database, store in variables and pass either in hidden fields or in the URL to the next page. Now I am having major issues and I need to know if it is the beans causing my problems.

Pages that loaded correctly are now not loading correctly. There are too many instances to go into but the pages just don't display well. Though some will if they are refreshed. If there was a problem with my code would it not display at all everytime I get the page instead of clearing up when refreshed? Or loading sometimes but not others? (and I mean with a 10 minute period).

I was demoing the project this morning, there was nothing wrong. It ran perfectly. Then all of a sudden pages that were displaying properly wouldn't display anymore. We demoed for over an hour before it crapped out. I don't think its the code because if there was a problem with it I would have gotten these errors on my machine (we were demoing on the boss' machine in another room). He thinks the problem is the javabeans.

Tomcat is giving me the error:
[Microsoft][SQLServer 2000 Driver for JDBC]Connection reset by peer: socket write error

I know this isn't the sql forum but what I need to know is if javabeans can give me this error? Can they cause any errors that I might not be familiar with? Should I switch back to using request.getParameter to pass all data? I need to have a finished demo on Tuesday so I need to know fast if I need to convert all the beans over to the old request.getParameter style?
19 years ago
JSP