stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Come on Peter use your Crystal Ball to identify the Error !!! ;)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This piece of code should do the trick for your project.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Peter's query would give you three rows each row indicating how many leaves left of that particular type for the given employee. From your posts .. even the last one I feel you needed that.
However in case you just need the total number of leaves left for an employee you could use

SELECT SUM(m_bal)
FROM TABLENAME 
WHERE m_emp_no='1004';

The above would give you for just for one employee, in case you wish to get back the balance of leaves for all employees, you could use:-

SELECT m_emp_no,SUM(m_bal) 
FROM TABLENAME
GROUP BY (m_emp_no)
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Your code is almost a hundred lines, and your indentation is inconsistent, it would have definitely helped if you would have followed one indentation pattern at least consistently

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i am doing a project sms base database managmen system using java. i want to know how to read that sms using java.
this is my college final year project.
this is sale markating project.using sms customer can order gods. i used predefind sms format to do this. normal mobite phone i use for this connecting pc.(as a serial port )

Buddy you really need to learn about your domain, basically what you want is to be able to read incoming messages received via a GSM Modem (and in this case your cell phone-> which internally contains the GSM Modem).
From what I can see it appears to me that you are using AT commands directly to communicate with your GSM modem, this would mean that you will have to write your own code to actually decipher the message from the content you get, in this case I guess you will have to write your own function to do the decoding or you could switch to TEXT mode instead of PDU mode. Look here for more information on that.

However I would actually suggest you use the SMSLib library which will handle these low level tasks for you (so you will not have to manually hit the AT commands).

Also a suggestion, when you are working on a project do a little background work on the technologies you are using so you know what is happening. A simple pointer to the …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Mark the thread as solved please ... I wanna increase my solved threads count :P

Alex Edwards commented: Well if he forgets to do that, I'll at least give you the rep =P +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well honestly just like Peter I am not clear with what you require ?
Tell me your exact motive, what is this a part of ? What is your end objective ?

Are you trying send / receive SMSes via GSM Modem ???

I need to know that before I know what to recommend or whether I can recommend anything?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

<EDIT>: Sorry guys mixed up my tabs in firefox, post was meant for "Pdu to text..." thread in Java forum

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Better search the forum first for your issue and then make a thread (if no such similar threads exist), I will help if I can, but there are a lot more guys much better than me (and wouldn't mind sticking with you for hours) who also wouldn't mind helping you out as long as you show the effort from your side, Also (although you haven't as yet) don't PM that would just irritate people, if we know we will answer in the thread else we won't if we do not know.

.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This has more to do with Java script than with JSP.
But can I see what have you been trying.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

We need to see what have you tried first.
Also do not mix database connectivity and your business logic directly inside a JSP, the following tutorial is a great guide on how you should design your web applications in JSP.

http://www.daniweb.com/forums/thread141776.html

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Although I haven't used it, have you tried public void addSelectionInterval(int index0,int index1) in the DefaultListSelectionModel class.
Also have you set the selection mode to MULTIPLE_INTERVAL_SELECTION .

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The following thread is pretty good tutorial on how to manage your database connectivity in JSPs, created by Peter one of the moderators here.

http://www.daniweb.com/forums/thread141776.html

Here is the Java EE 5 tutorial also a very useful resource:
http://java.sun.com/javaee/5/docs/tutorial/doc/

Also you might find the following javadocs useful when you are searching for certain
classes / methods with some functionality

http://java.sun.com/javaee/5/docs/api/

Also use your JSP as mentioned in the tutorial just for displaying your data, your processing / business logic should be written in Java (Beans or in the form of an API, to which you just pass data from here and get back the results for display) only, So in case if in the future you change your view layer from JSP to say Swing your processing logic will not need to be touched.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I do not know about the apache2triad, But on LAMP the "php.ini" file contains a parameter called as "display_errors", to turn on the errors you have to set display_errors = On and restart apache,

Try searching for a file with a similar name in your apache2triad installation. Hopefully it should have the same name.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well checked it out but honestly I found the reference manual more comfortable to look up to but I guess it will differ from person to person (since I have been using the reference manual for almost a couple of years now)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Problem with your post is that we just can't help you, if you would have thought about telling us your level of expertise in Java and the fields / domain in which you have some experience with may be we could have at least given some suggestions, but you expect us to just magically come up with a project topic for you.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I got 100% and 91% ... But I cheated :P I dint take the 5 minutes break mentioned both the times

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

From what your mentioning I do not see any link to actual sessions.

But for your requirement read about synchronized methods in Java and just apply the same to whichever method(service(), doGet(0 or doPost()) you are using to process your requests in the servlet.

Although I think there should be a better way to achieve what you are trying to without restricting your servlet to just service one request at a time.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Man another *%$#@&* thread on mysql & swing created by kevinpeterson22,
what the hell is your problem ?
When some responds to any of your threads you just do not reply back.
Do you think just cause you are making thread after thread on the same topic some one is going to do your work for you ???

Three threads (Now merged to one by the moderator):-
http://www.daniweb.com/forums/thread142547.html
http://www.daniweb.com/forums/thread142547.html
http://www.daniweb.com/forums/thread142547.html

And you refuse to provide any information on the errors you are encountering.
Basically I am begining to think you just picked up that code from the internet (or some kind soul lend it to you) and you want us to fix it for you.

Alex Edwards commented: XD +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Use an ArrayList, so your list can automatically grow as you need it to.

Yep in front of that solution my post can be put in the wastebasket !!! ;)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I can suggest you two not so good solutions :-
First is parse the contents of the file and check how many new line characters ("\n") do you find in the entire file and then you can set the first dimension of transArray accordingly.

Second is in the while loop on line no 33 for WordReader.java, there at run time you can detect when you have exceeded to size of the array and then create a new array of dimension [transarray.length+1][3] , transfer the contents of transArray to this new array, and finally assign this new array to transArray variable. So you now have a dynamically growing array, if the no of lines in your file exceed the initial capacity assigned to transArray.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here you go, this should do the job.

peter_budo commented: Bullseye ! +10
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Laziness, the worst illness of humankind.

especially considering the fact that the JDK comes with quite a few good examples !!!

@ thread starter
Have you ever browsed the installation folder of your JDK ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I understand that so how can I rectify that and how come if I had only two classes i.e Chapter and mainPrg it would have been able to access it? (Am basing this on the fact that I have tried the latter and it seems to work)

Sorry but that is not possible, you just haven't declared the said method in the Chapter class, So it doesn't take a java compiler to tell that you have an error there.

Most probably when you are working with only two classes you must have also deleted the code on line 119 and so might have not got the error.

Also here is link on conventions used while writing code in Java.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

chptobj1 is an object of class Chapter , whereas printInfo() is a method of class Book . So definitely Java can't find printInfo() method in the Chapter class.

It should have been bkobj1.printInfo() , But you should be able to trace and solve such errors on your own.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi

sorry for that to create an duplicate threads.

I didnt get any positive reply from that previous thread thats why

Regards
Kevin

No one is going to give you some sort of magic bullet to solve all the problems in your code, you need to do first what is asked of you, if you expect to find the solution.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Do not make duplicate threads. This is the third thread with a similar topic, thats why I gave you the negative mark. You did not even care to respond to the people who tried to help you in the first thread

Alex Edwards commented: Saved me the trouble =P +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

normally no, username maybe, but from a little I had read, some may contain your sessionId etc.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Please use Code tags, cause if you care about getting the solution, then you should also care about the forum rules.
And one major problem, you have not mentioned the problem, is the program compiling, if not what errors are you getting, if its compiling what is the output you are getting and what do you wish to get ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
while(rs.next())
{
if((rs.getString("m_emp_no").equals(user)) && (rs.getString("m_password").equals(pwd)) )
{
" " direct to some page
}
else
{
<script language="javascript">
alert("Sorry!Wrong User ID or Password entered.Try Again");
document.f1.action="loginpage"
document.f1.submit();
}
}

I notice the following problems :-

  • First no indentations
  • Next I do not know where does this code go, is it inside a servlet or inside a JSP page, either way you should get an error cause you are directly mixing html with java code without appropriate delimiters
  • And the code you are using to redirect you have completely skipped it from what can be seen, which is from your description appears to be where the problem lies.
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

You can write objects on a socket, Read about serialization and the Serializable interface.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I will **NOT** give you the code to do this cause very simply I don't want to ruin the motive for which your course (whichever you are doing was made) but I will give you the logic on how to go about this.

Now consider the JSP in which you are displaying the details of a person, lets call it dispdetails.jsp,
Now what you could do is make this take page take a parameter say "personId", which uniquely identifies the person whose details are going to be displayed in the page.
Next when you are querying the database for the details of this person, you could also fetch the Unique Identifier of the person next in the list and store it in a variable say "nextPersonId".
Now create a form like this

<form name="frmnext" action="dispdetails.jsp">
  <input type="hidden" name="personId" value="<%=nextPersonId%>">
</form>

And when some one clicks next just post this form via javascript and your JSP page will display the next person's details(as it receives the next person's Id in the "personId" parameter)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Try using session.setAttribute() / session.getAttribute() instead of request.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here you go.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The solution is do not do database connectivity from inside a JSP. Check this thread to see how to go about this the right way.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here you go, best of luck for your MCA.

javaAddict commented: Good reply +1
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Please use code tags and pay a little attention to the rules before posting.

Anyways if you just want to display the data in another window, the I would suggest you take a look at the JOptionPane

Also an alternative approach if you find the JOptionPane dialog boxes too restrictive would be, you extend from the JFrame class in your own custom class (ex. MyFrame), take the contents you want to be displayed as parameters to the constructor of this class(MyFrame), and display the contents using the appropriate controls(JLabel or JTextArea or JTextField ... whichever you wish).

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

If you are just starting Java, then you should look at this thread, Its been made sticky by the moderaors for you guys only.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
Alex Edwards commented: Haven't seen you in awhile? =P +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I already gave you the link to the Javadocs, and from what you mention I think you need the getRequestURI() method and not the getRequestURL() method.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi..!

I am trying to get whole browser in my jsp page.
I have a sample url as, "http://www.ab.com/#/pages/ab"
I need this whole URL to be print in my scriptlet code in jsp.

I can't use javascript as that is disabled. I tried with REQUEST objets several methods like getURL and all but still not able to get whole URL as it displays in browser.

If you have a answer then can you please reply with snippet of code please.

Thank you in advance.

Strange I've never encountered getURL method in the HttpServletRequest's javadocs, Try searching here.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Depends on what is your current working directory i.e. the directory from which you are running your Java program.
For example if your current working directory is dir1 , then your relative path would be conf/a.txt Else if it is dir2 , it would change to ../conf/a.txt But if it is dir3 , then I think you will need to use the absolute path !!!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Can i mask the sender if am sending through GSM modem. i.e i want a name "klnce" as the sender name instead of mobile number.

No Idea about that as I have never tried it with a GSM Modem.

But I do know for a fact that many bulk sms providers do allow you to set your own sender-id, depending on the destination you are sending to. (cause in some countries you need to pre-register the sender-id you would like to use)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I have worked with an older version of the BenQ GSM/GPRS G-32R Modem, which connects on the serial port of my PC, It should cost you around 6000 to 8000 Indian Rupees,
There are also a few modems which connect on the USB port, but I haven't worked with them.
Also now-a-days many cell phones for ex the Nokia 7110 can be used as a GSM Modem by using the DLR-3 cable. This is a good option for you currently as you seem to be just starting up with messaging as you may be be to use your cell phone directly rather that buying any equipment before hand.

The advantage that GSM Modem offers is that you will also be able to receive Smses, but in case you are planning for a high volume of SMSes to send you should look the bulksms providers option cause it may be cheaper and the speed of sending SMSes will definitely be faster (GSM Modems are slower, they might send at most 3-4 SMSes per minute depending upon your model).

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ok got a solution to your problem here with just a little googling.

It says to install the libc6-dev package.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well can you tell us what you are trying to achieve here actually, I don't have much to go on from what you have posted !!
crt1.o looks to be an object file and it seems like your linker (ld) can't find it, but what are you actually doing when this error arrives would help us get a clearer picture.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I guess JavaAddict already beat me to it, All you need to do is take the TotalInvestment and Duration as Input and calculate the Interest amount by the formula given in your question, depending of the value of Duration

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

You must be joking, you are not mentioning what errors you are getting , what sort of an application this is (console or gui), what you have tried to solve those errors, ... in fact you have not even mentioned which compiler you are using !!!
And you expect us to solve those errors for you ????

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

No point to repeat that, this guy completely ignore that for last two weeks from me. Another hopeless case to bang on...

yep ..... you have one witness here, who saw it first hand !!! ;)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i have shortage of time please do this for me

So your time is precious .... and not ours !!!!