stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Or you could have done the same thing that adatapost did here and have found out the answer more faster.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

My code compiles but does not print the contents of the ExtendDVD class. I have the three classes saved as seperate files.

Well just a quick Search of your code revealed that you have never created an Object of ExtendDVD so I guess its logical that nothing from it would be printed.

VernonDozier commented: Beat me to it! +15
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Rather than making your own why dont you just try some of the freely available Database Connection Pooling libraries.
Look here for a list of them, For my apps I normally used the DBPool library.
Alternatively if you are using Tomcat you can check this article

So if you use a standard pool of database connections, whenever you wish to query the database, just checkout a connection from the pool, fire your query, process the resultset if any and return the connection back to the pool.
So you neither will have the problem of continuously opening and closing connections nor the problem for one user occupying one DB connection for his entire session.
Also you can read the following references to know more about the importance of Connection pooling : 1,2

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Then I tried to emulate file system I had no idea how to do that. BoxedApp SDK helped very much.
(But that project I wrote in C++:) )

And I am sure the guy has already solved his problem 3 years ago, Talk about speedy replies !!!!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I do not know how to execute a macro, but what you could do is Query your MS-Access database and write the values from the recordset into a file CSV format (which can be opened in Excel) or alternatively you could use Apache POI to write it out in the proprietary Excel format.

Ezzaral commented: Sounds good to me. +21
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i just left the answer blank. that is why i was really surprised to see a c++ geek who is blonde and cute( i am not allowed to give her name, you know her anyways).

Dude, not again !!!!

please if you read my threads, dont read them with attitude or prejudgement. the escense of why i write here is sharing, decreasing the feeling of loneliness in me. that is it, nothing more nothing less..

Now although you say the above, you did say earlier :-

The problem is in this area i dont think there are enough depth thinkers or educated people.

So even though you wish to escape judgment from us on your character based on your thoughts, you go on and do the same to all people (the girls I assume) in your area.

And the problem is not out there, its in you, before hunting for a girlfriend why dont you make a few girl-friends first.
Also what kind of girls do you expect to find at strip joints ??? Even though I have never been near one, I can definitely bet they wont we those smart programmer types you are looking for.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

26925748508234281076009

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This should help. It was the first search result in Google.

Ezzaral commented: That Google guy knows all kinds of good stuff! +21
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Currently listening to "The Never Ending Story" theme song, never get tired listening to it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well apparently I am now out of guesses, so just as javaAddict suggested can you give a printscreen of what icon of Tomcat you see in the System Tray.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

There is no comnspiracy, the Dude deserved it, as did everyone else who gets banned. There is no conspiracy when the application of the law is universal.

We told him 3 times about piracy and about 2 spam, and each time he ignored the warnings, so he got a ban.

Chill JB, I wrote "conspiracy theory" with just a light heart, no need for any justifications here :D .

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

do you know why he is banned?

Well you can find the formal reason and the conspiracy theory both on this thread :- http://www.daniweb.com/forums/thread183273.html

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

(this reminds me rashakil fol, where is he now do you know?)

I am guessing he is still banned.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Could you give me the version of JDK as in 32 bit or 64 bit. I had encountered a few problems recently while making Tomcat 6.0 run using a 64 bit version of JDK6.0 (on Windows).

Another wild guess is that maybe your "hosts" (C:\Windows\system32\drivers\etc\hosts on WinXP) file does not have a mapping for "localhost". So you could try "http://127.0.0.1" and see what turns up in your web browser !!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well how did you verify the server was running if the page was not being displayed ??

Also can you divulge some details as to what version of tomcat and JDK you are using ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Without a space on either side of =

Used to do the same before Peter_Budo told me about the noparse tags.

You can use the noparse tags around your code block like this :-

[noparse] [code=xyz]

[/code]
[/noparse]

You can read more about the various vB tags here.

jephthah commented: ah... THAT'S what i was looking for! +7
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I already had a feeling you were working on a web application, thats why I had asked you to use sessions in your JSP, You can check this tutorial to see Sessions in action. I do not know about Struts so cannot suggest anything for it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

But if we click on the explorer icon we cann log in using other mail id...

No it doesn't and I checked your "claim" by putting Windows in my VirtualBox and if you are already logged into Yahoo in one window and click on "log in" in the next window, it would just ask you for the password to verify you session, it doesn't ask for the username. Also if you click on "Sign in as a Different user", your session in the first window is lost. So in effect you are just able to log in with one mail ID at a time.

Anyways,

I ask u, is there any way to trace this using java code

I already requested what technology are you talking about, you have not given us a hint as to whether this is a web application or just a normal desktop application with a client and server etc.

You need to give us more information on what your project is about.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

For the major ones there are Struts, JSF, Spring and then you can check quite a few here.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

in IE we can log in a yahoo Mail with a number of mail id at the same time

Although I haven't used a Windows box for quite a while, I do not think that is possible. You only log in with one mail Id and the other IE windows will pick up the same sessions from your cookies.


BTW What technology are we talking about here, from the examples I get the hint its JSP / Servlets, which have their own forum here..
And finally if that is actually what we are talking about then you can use "sessions" and "Cookies" in your page to achieve that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The question is how do I go about splitting the strings? I know there is a split method but I'm not sure how to use it.

Its as simple as :-

String[] splitString = book[i].split("-");

Look here for more details.

But beware of the "-" in "Addision-Wesley", even that "-" will be used for splitting, So either you will need disallow the user from using "-" in the original Strings or you will need to manually replace the "-" with some other marker when you concatenate them and then replace that marker with "-" when you want to again display it later after applying the split() method.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I do not exactly whats wrong since you have not given us the table schema, but have you tried just printing the value returned by rsmd.getColumnType(1) .

Although just for the record I do not see why it should be different from one given by rsmd.getColumnTypeName(1)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Strange !!!!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

what about this one?

What do you mean by that ??
If you have a valid problem then create a new thread, do not simply hijack old threads.
Also post your analysis of the problem what are your thoughts, what do think is the root cause and what did you try to correct the problem.
Simply posting the problem without giving us any background information about the web application nine times out of ten isn't going to help much.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well you could use a PayPal business account.
Although it doesn't cost to create an account, they do charge a fee for any transactions you perform, Also you can check here on how to integrate PayPal with your website.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Firstly I would suggest you check your CPU usage and Memory Usage, if your machine itself has high CPU usage (or Memory Usage lot higher than your physical memory) then irrespective of the container used your System is bound to become slow, the solution to either problems is to upgrade your hardware.
However the other thing that caught my eye was that your client application which calls the servlet sends requests a lot faster that Tomcat can finish processing a request for your servlet. Now you might be aware that Tomcat spawns a new thread for each request and there is a limit on the, maximum number of threads that it can create (specified in the server.xml file), in your case although this is just a guess, it seems like tomcat is running low on this value and hence before another request (for any webapplication in your Tomcat) it waits for a current request (for any other webapplication) to complete execution.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

@Vernon
Apparently I too thought he was more interested in finding the roots of his cubic equation, but reading his posts I guessed he was more interested in just plotting the graph.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I've done the layout but now I don't know to implement the maths.

The quick approach which comes to my mind is store a,b,c and d in an array say "coefficients" of size 4 and let the index at which the corresponding value is stored indicate the power of "x".
Ex:-

coefficients[0]=d;
coefficients[1]=c;
coefficients[2]=b;
.....

Now to calculate value of "y" corresponding to the given value of "x" would be as simple as summing up the value of :-

y = coefficients[index] * Math.pow(x,index);

for every element in the coefficients array.

The second approach to calculate the value of "y" which the programmer in me despises is the more mechanical approach as show below:-
Assumptions:- Current value of "x" is in variable "x" and same applies for a,b,c and d.

y = a * x *x *x + b * x * x + c * x + d;

Notes:-
If you wish to try the first approach you may read about arrays here and here.
Here and here are example how to parse through arrays using the "for" loop and "for each" loop respectively.
You can also see that javadocs of the Math class for the pow() method

Salem commented: Nice +29
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Give us the complete URL on how you are calling it,

Is it like this : http://localhost:8080/<project-name>/myServlet
Also can you access "index.jsp" ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The problem is occurring where you are constructing your SQL query you need to show us that code, for us to trace the error.

Also Just for your Information, in case one of the values you wish to insert inside your database contains problem characters like the single quote ('), I advise you use the "PreparedStatement" as shown below:-

String name = "abc'jhd";
.
.
Connection con = DriverManager.getConnection(.....);
PreparedStatement ps = con.prepareStatement("INSERT INTO student(name) values (?)");
ps.setString(1,name);
ps.executeUpdate();
.
.
.
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

On DaniWeb I find a lot of geeks. ;-)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

is that much
of pain worth that taste ?

Man if I am not wrong was a Hunter before he settled down.

Also if you would have followed the experiments of Sir Jagdish Chandra Bose on plants heres what Wiki quotes:-

In his research in plant stimuli, he showed with the help of his newly invented crescograph that plants responded to various stimuli as if they had nervous systems like that of animals. He therefore found a parallelism between animal and plant tissues.

Heres from another source:-

Bose demonstrated that plant tissues under different kinds of stimuli like mechanical, application of heat, electric shock, chemicals and drugs, produce electric response similar to that produced by animal tissues.

So technically even if you are a vegetarian you are causing the same kind of pain to plants, only difference is they suffer in silence, So which diet are you planning to go on next ? ;-)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I know how to do everything except separating the 85 into 8 and 5. Should I use a modulus calculation & make 85 an integer? If anyone could provide a solution in code (just the separating 85 part) I would be very greatful

Well that could be accomplished by just a combination of <number>%10 and <number>/10. (Of course the <number> should be an integer).

First you perform a mod by 10 on the number, that would give you the digit in the units place, next you divide the number by 10 and the quotient you again mod by 10 to get the number in the tens place, keep repeating it until the division by 10 gives a zero.

As far as your "pow()" call is concerned, the last time I used C++ and specially "pow()" in that, I recollect it needed the base to be either a "float" or a "double" while the exponent could be an "int".
Try casting your "n1" to either of these and check, Of course I could be wrong.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

if(letter == "$PART2")

You can't test a String's contents by using '=='. It only works for primitive types, String is an Object. Use the String class's equal method

Just correcting, he means the equals() method of the String class

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I assume you are getting the SQLException on the third line.
To create the table you will need to switch to the database you just created by using the use db-name statement or else while creating the table itself in the create statement you will need to specify the name of the table as CREATE TABLE `db-name`.`table-name` .

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

my program won't even run so i must have missed something drastically but i don't see it....

Excellent analysis of the problem, also let me congratulate you on the wonderful code alignment technique you have pioneered.
Also do not directly copy paste your assignment.

Here are a few pointers you need to look into

  1. while and do while loops in Java - Look here.
  2. Reading an Integer from Console in Java
  3. Sun Java Code Conventions, no need to read the whole document, just go through the basic parts related to code indentation, variable naming etc.

And Vernon already has pointed out the "main" part

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

632

Resistance is futile, we already lead 1 - 0 and its looking good for 2-0 lead. :P

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

A trigger will not be able to notify the DB. The "easiest" way is to set an autoupdating timestamp field on the concerned table, then, every so often, retrieve all records with a timestamp newer than the last time you checked.

To repeat, the DB cannot (at least in the frame of JDBC and "normal" Java) notify the program, so the program needs to poll (i.e. periodically query) the DB.

Yep acknowledged doc, thats why I mentioned

Also then all your code would be PL/SQL and not in Java

So whatever he wished to mean by notifying, if it was **just some other db operation** he can accomplish it using PL/SQL in his triggers.

Of course yours is best solution applicable to almost all situations.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

But do you mean I have to write a method that occassionally send a SQL query for example every 10min to the database. To check if a certain table has increased in row number?

Alternatively you could use database triggers, but beware of their performance as triggers may affect the performance of your Inserts, Updates etc. Also then all your code would be PL/SQL and not in Java.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi,
I wonder if it's possible to check whether a MySQL DB has updated. e.g. new information is added to a table?
and if it detect an update. it will perform search or something else.
Main question is if it is possible to listen for changes in the db.

And how is this connected to Java ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

632

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

In the absence of the context we are talking about, I would simply suggest stop the situation which ultimately causes the IOException to be thrown.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This **seems** like a production level project.
Now considering using three different DBMSs', you will no doubt have to use three different drivers for each of the databases. First thing I suggest is is use a Type 4 Driver for each of the DBMSs (eg jtds for SQL Server, this for Oracle, etc) apart from MS Access for which I have not yet come across one (because the JDBC-ODBC bridge will give you the worst performance in terms of features as well as speed).
Next as the database changes, the driver that you choose to load (using Class.forName()) would also have to change, and with that the Connection URL would also change.

Next you would also have to limit yourself to using just the standard SQL features (SQL 92 if using SQL Server 2000) in order to avoid rewriting your SQL Statements again and again for each database.

These are just **some** of the things that come to mind that you will have to handle.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Peter has already mentioned the cause of your problem, now just wanted to add a few notable things like :-

  1. You never closed your connection, Its important to close your database connection once you are done using it. Preferably put the call to close() inside a finally block, so that your database connection is closed irrespective of whether an SQLException was thrown during your query execution etc.
  2. In the catch block where you have caught your SQLException always print / log the SQL State by calling e.getSQLState(), by comparing the SQL State with your DBMS vendor data example here, you can map out exactly why your query failed.
peter_budo commented: Well spotted +16
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Yeah i tried that but i didnt like the format, and didnt need all the info.

From that **I assume** the output already contains whatever information you needed.

Well honestly jbennet I didnt expect to be saying this to a Moderator but just a little R & D (a little bit of googling or looking up the javadocs) on what the "System.getProperties()" method returns and a little more effort on figuring how to parse and selectively print the contents of a java.util.Properties object could fetch you the answer you desire.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I have to make a database in oracle and connect it with Java. But I'm not able to do so.
Please help.

I want to make a space ship and fly back to my home on Mars, please help me too.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

AFAIK you cannot pass values assigned to variables in Javascript to your Server Side JSP pages without putting the actual values inside some form fields viz. the "input" element (eg hidden fields, text fields etc) or "select" element etc.
Either that our you can pass them as part of the invoking URL eg http://xxxxxx/page.jsp?value1=ccc&value2=vvvv....

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Dear I need Help in "ActionPerformed" section

Now "Help" is too generic a term here. It can be a drowning man calling out for "HELP" or financially strained person asking for "HELP" etc..

Tell us what you want the program to do and from what you have implemented what is happening and a little analysis on why you think it is happening and do not simply quote your instructor's questions, because as this announcement mentions we only help those who show effort on their part to solve the problem.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

So .... where do you need our help ??? (Apart from giving you pointers on code tags usage)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

It seems like you have some other "Statement" class included in your Servlet as opposed to the "java.sql.Statement". This is pretty easy to decipher as your compiler has clearly stated:-

java: 95 : cannot find symbol
symbol : method close()
location : class java.beans.Statement
stmt.close();

Check your imports and in case you have some other custom class/interface/Enum etc called as "Statement" already imported then I suggest you use "java.sql.Statement" whenever you wish to perform some SQL stuff.

Also a suggestion to help you in debugging, In the rush to find a solution do not forget to first understand the problem i. e. just ponder over and try to understand the error messages before looking for a solution.

BTW please use code tags whenever posting code. It is as simple as putting
[code=java] and [/code] around your code. It has many advantages like preserving indentations, providing syntax highlighting and also makes it easy to copy paste the code in case we want to test it at our end.