peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1. Professional thousand of pounds/dollars less time
2. Single individual/friend maybe few hundreds with plenty time in waiting

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can write your own isInteger method like (

public boolean isInteger( String input )
{
   try
   {
      Integer.parseInt( input );
      return true;
   }
   catch( Exception e)
   {
      return false;
   }
}

or you can use patterns, but that can be overkill

mKorbel commented: why not :-) +9
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Because you used executeQuery instead of executeUpdate

PS: Writing with Caps Lock is like shouting, that is considere rude.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Also, if personally you wish to slightly increase the population of Daniweb, simply "Share" Daniweb via Facebook, sharing it to every friend on Facebook.

Most of the people on profiles for any of us working developers have family and close friends. From these less then 10 if not 5% would be interested in programming and are most likely knowing that what forum we do frequent.
The other side of daniweb population are students having often 100+ of people because they add their class mates, from school to school, from year to year. Are we interested in adding more student traffic with load of homework stuff that is here year after year? I do not think so.
We are unlikely reach status of stackoverflow, but we should be more then student homework back yard. We may want to aim to attract junior people fresh from school getting trough first real life projects, trying to learn more about programming design, problem solving best coding practices, testing, security, maintenance and more.
Think more "out of box", your current school is not everything, there will be one day reality check with your professional carrier, do you want to say "hey I'm member of daniweb" and get reply "ahh that homework solution website... Are you proud of it?" (No harm mean Dani, but I believe we can do better)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Without code nobody will be able to help you.

PS: Would be nice if you closed other threads that you created and which received reply or post back if you need more explanation on given topics

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You welcome, just in future please, please provide more in detail description. This does greatly help us minimize unnecessary communication of more info demands and providing too much general info that may not be helpful.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This can usually can be achieved by Runtime class, I had a post on it few year back that you can see here. What you would have to do is execute application name and give it absolute file path. Secondly you can use something like JACOB library (small tutorial)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) Watch your attitude, it is not first time you asked a question with very little explanation and expecting immediate answer, coming back latter moaning that nobody is helping you. Questions get answered faster when we know what exactly person wish to achieve and not when we second guess what they actually mean to achieve.

2) So am I correct to assume you wish to call on some system installed application (Microsoft Office, Adobe Reader), providing file name and want to have it opened?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to provider better description of what you want as above doesn't tell us anything.
>>How to open already present text file
File where on user system, on server, in memory?

>>So user can see the data in that file
See it where GUI view, in the browser, or some native application(Microsoft Office, Adobe Reader...)

>>I dont mean FileInput or OutputStream open
And what do you mean? We do not see on what sort of project you are working, or what is happening in your head so we would know what you about....

Given number of posts you already made one would expect higher quality of problem description instead of tree sentences.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OMG. I thought you would give me a headstart. Tell me where to start with. Is there any book that deals with such apps?

You said you did not wanted other people d your homework, so I just gave you possible idea how to about GUI since you been struggling with the idea.
Follow also James advice on DB, ask specific questions, and there is only one book that will show you how to do it step-by-step life experience of trying and failing with some bright spot of success and appreciation.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You will not get guide, but you may get tips/suggestions/advise. For example create parent frame. Attach panel and menu bar, with menu options for the bar. Menu options will refresh panel with child panel holding all components associated with what ever procedure you trying to do.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You did not indicate selection with setSelectedIndex(int elementNum, boolean selected) . You need to select as GroupChoice is rendered without any pre-selection

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

One of the mistakes in old API you can call it. All types(EXCLUSIVE, IMPLICIT, MULTIPLE, POPUP, TEXT_WRAP_DEFAULT, TEXT_WRAP_OFF, TEXT_WRAP_ON) are inherited from Choice that both ChoiceGroup and List implements

PS: Next time would be nice if you state which platform/language question is related. I know answer only because I used JME previously.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What doc are you getting that from?
My API doc has this:
protected Object clone()

Just open the class in IDE and get source (that is how it does work in IntelliJ), then you can see internal structure :)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you referring to http://www.daniweb.com/software-development/java/threads/99132 then that yes, some of them are out of date because post was originally created in 2007.
However it still holds ground with titles like Head First Java or Java How to Program from Deitel & Deitel.
Head First Java will give you very good ground up explanation of Java basics. Java How to Program will give you introduction to Java and it will take you through various areas like GUI development, applets, database connectivity, basics of Java web development.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Off topic: @bobytch writing posts all in capital letters is considered as shouting and very rude. So please take it in consideration when you post next time

Salem commented: yes +17
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Have you ever tried to write tutorial, or lecture? Maybe perhaps presentation for your class? If you want to do it properly it does take time to write some decent tutorial. Code snippets are faster, but then they just small examples of code that we found "handy" and wanted to share with others.
We do have monthly newsletter, but that is only for internal purposes and for these that are interested. I regret, that Dani removed the link to newsletter archive and so far did not found it as a priority for adding it back, even though many of us asked for it.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

9 views means nothing. It could have been moderators checking for possible spam. Did you consider that?

Have look at this discussion @stackoverflow

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Majestics do not blame people for not giving you fast reply given the "extensive" problem description. Ezzaral tried and you slapped him with already solved
As for negative reputation, no big surprise. You ask question, come back in few hours "anybody home!?". We are not 24/7 coding service, we help when we can.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Its possible in JSP as well as sevlet..

Possible, but not advised.

@anand01 you already received correct reply in first. Didn't you read linked article?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I already solved it.......

So where is solution? Why you not sharing?

mKorbel commented: prevent agains down-voting +8
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

How about promote this great website on the social network, like Facebook, as you said, advertising it.Then Facebook FriendAdder Pro can do you great favor, because this program enables you to get quality targeted traffic.

Daniweb is already on Facebook, just search for it. Nevertheless from that side I would expect only another horde of lazy students to come and post homework requests for C/C++/Java/C#.
Daniweb is simply buffer place for start-up programmers (I'm excluding lazy students), unfortunately search for serious stuff will not land you here (more likely stackoverflow and other professional sites).

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Word of advice, SCJA is built for people just really starting with application development. It does contains minimum of coding, object-oriented concepts, some UML and also Java Platforms and Technologies.
This exam is NOT pre-requirement for SCJP. On other hand SCJP IS pre-requirement to any advanced exams SCJD/SCWCD/SCMAD. So you may want to directly jump on SCJP. No need for simulators just get your self Sun Certified Programmer for Java Study Guide and you have all that you need to pass exam

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Did you downloaded spring library and associated with your project?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You normally don't. You either provide JAR file that can be executed from command line (or double click, but this often fails with Windows due to wrong registrations of execution services) or you provide it as WAR/EAR file that is deployed on some Java container/server

Many people specially students insists on creating exe files, which is possible with some additional often expensive tools. You can read about it here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

A) Provide this as parameter when calling upon this class (meaning before you call the class, you retrieve reference and then just forward it to class)
B) When calling class provide instance of activity as one of the parameters of call (this will allow you to use activity directly from simple class)

However "A" woud be more desirable approach

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Majestics you better start using PreparedStatement. Direct sql string like above is just like shooting your self in leg once trying to sort all single and double quotes locations.

PS: Marking thread as solved would be appreciated.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

To wide request. Did you had look at Oracle Reports Documentation, also includes Oracle Reports Java API Reference

mKorbel commented: patience +8
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Use PhoneStateLisenter to listen out for changes in the call state, with the onCallStateChanged method.
Once state change from CALL_STATE_OFFHOOK to CALL_STATE_IDLE trigger/wake-up your application

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry I just spotted that you actually use PreparedStatement in both cases but you are using it wrong way. You still try to inject variables directly into SQL query while building string.
Something like this is error prone, you can easily mismatch opening and closing single or double quotes, or forget to include plus sign

String query1 = "UPDATE Info SET" 
                            + "lastname='"+jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString()+"',"
                            + "firstname='"+jTable1.getValueAt(jTable1.getSelectedRow(), 2).toString()+"',"
                            + "middleI='"+jTable1.getValueAt(jTable1.getSelectedRow(), 3).toString()+"',"
                            + "age='"+jTable1.getValueAt(jTable1.getSelectedRow(), 4).toString()+"',"
                            + "course='"+jTable1.getValueAt(jTable1.getSelectedRow(), 5).toString()+"',"
                            + "school='"+jTable1.getValueAt(jTable1.getSelectedRow(), 6).toString()+"',"
                            + "contactno='"+jTable1.getValueAt(jTable1.getSelectedRow(), 7).toString()+"',"
                            + "contactno2='"+jTable1.getValueAt(jTable1.getSelectedRow(), 8).toString()+"' "
                            + "empbg='"+jTable1.getValueAt(jTable1.getSelectedRow(), 9).toString()+"',"
                            + "position='"+jTable1.getValueAt(jTable1.getSelectedRow(), 10).toString()+"',"
                            + "dateapplied='"+jTable1.getValueAt(jTable1.getSelectedRow(), 11).toString()+"',"
                            + "remarks='"+jTable1.getValueAt(jTable1.getSelectedRow(), 12).toString()+"',"
                            + "WHERE ID ="+jTable1.getValueAt(jTable1.getSelectedRow(), 0)+";";

where clean query declaration and then providing parameters is far better and more readable

String query1 = "UPDATE Info SET lastname=?, firstname=?, middleI=?, age=?, course=?, school=?, contactno=?, contactno2=?, empbg=?, position=?, dateapplied=?, remarks=? WHERE ID =?";
preparedStatement = conn.prepareStatement(query1);
preparedStatement.setString(1,person.getLasttName());
preparedStatement.setString(2, person.getFirstName());
preparedStatement.setString(3, person.getMiddleI());
preparedStatement.setString(4, person.getAge());
preparedStatement.setString(5, person.getCourse());
preparedStatement.setString(6, person.getSchool());
preparedStatement.setString(7, person.getContactNo());
preparedStatement.setString(8,person.getContactNo2());
preparedStatement.setString(9,person.empbg);
preparedStatement.setString(10,person.getPosition());
preparedStatement.setString(11,person.getDateApplied());
preparedStatement.setString(12,person.getRemarks());
preparedStatement.setString(13,person.getID());

As for mKorbel request to check for null, what he is trying to say is did you validated your form before your try to update database? Are you getting everything from form correctly? Are user provided data valid?(any case of cell returning null value)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Delete operation : Error is explicit, you provided object/variable that hasn't been initialized and is therefore null. Error occurred on line Search.java line 363
Update operation : An error report file with more information is saved as:
C:\Users\OJT\Documents\NetBeansProjects\myjava\hs_err_pid2440.log
So you need to read that log file or provide code. Did you changed that query to prepared statement? Did you tried to execute query directly on DB as I asked you to do?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can let that baboon read this OpenOffice.org's Documentation of the Microsoft Excel File Format Excel Versions 2, 3, 4, 5, 95, 97, 2000, XP, 2003or Excel Binary File Format (.xls) Structure Specification

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

That is very broad request. Does it throw any errors when you execute it? Does your query works when you try it directly on database (command line or GUI tool, plus filling variable spaces)

PS: You should

  1. change that query to prepared statement as you have it in the other code sample
  2. extract row data as an object and not collection of parameters and provide some validation on it and then use it in combination with prepared statement
jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString()
jTable1.getValueAt(jTable1.getSelectedRow(), 2).toString()

vs

person.getLastName()
person.getFirstName()
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Of course it is possible how would people actually put together POI or similar. Question is for you to answer to your self or your boss is it really worth to do it hard way...

For me answer is clear, use POI and just provide data to create Excel documents on the fly. I do not need to learn about Excel document format, don't have to come up with routines to insert data into cell, row, column etc.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

and where should i put that snippet? here is my code. thanks.

After line 78 build a proper data Collection expected by DefaultTableModel, meaning instead of looping and sending data directly to table you build up single object that you then pass to table model

mKorbel commented: excelent, agreed JTable is my favorite ... +8
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

It is possible, but you would have to know hell more about the structure of Excel document, so you better to use POI otherwise it is likely to take months. Can you explain why you do not want to use any available libraries?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

For coloured row you can try to use this

DefaultTableModel model = /* CREATE DefaultTableModel FROM DATA AVAILABLE TO YOU, THERE IS NUMBER OF CONSTRUCTORS YOU CAN USE*/
  JTable table = new JTable(model){
    public Component prepareRenderer(TableCellRenderer renderer,int rowIndex, int colIndex) {
      Component comp = super.prepareRenderer(renderer, rowIndex, colIndex);
      if (rowIndex % 2 == 0 && !isCellSelected(rowIndex, colIndex)) {
        comp.setBackground(Color.PINK);
      } 
      else {
        comp.setBackground(Color.WHITE);
      }
    return comp;
  }
};
mKorbel commented: for safiest way as I know +8
ztini commented: You shouldn't do their homework for them... -1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@ztini rules do not dictate that one is forbidden for giving out code. However we do ask people

Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

That doesn't mean I will go and delete any homework request on forum. I have free hands on decision and it was unfortunate that your code was deleted, but OP

  • damped question on forum
  • gave it all possible highlights
  • failed to provide any evidence of work
  • he returned to check on answer by Schoil-R-LEA, and ignored request to work on it
  • then he returned to check on your answer
  • left without comment

It may be lame from me to delete that code after OP already seen it and presumably copied, but it may send warning to him and others like him reading this, that without putting some effort in it there is no quick solution.

I could go argue more about it but that is pointless. Anyone wishing to discuss this matter is free to send me PM. Thread closed

PS: Question - I wonder though--when was the last time you learned code by ... not looking at code?
Answer - Just last night, I was reading Implementation Patterns.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@akasekaihime
1) Sort out your bio description or we will do it for you
2) You are expected to do your part, we are not 24/7 service

@ztini
I snipped code, please do not give out solution so easily. Let poster do their part otherwise you are letting them waste time on facebook, gaming, partying, etc instead of learning. We do not care for lazy people, we care for these who are willing to learn.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

thnks...i appreciate ur help...it helps me a lot...

Well I would appreciate if you adhere to forum rules and use proper language too.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I do not want to be rude, but is it so hard to google for "midlet customitem example"?
Here are 2 general sources to start from Using Custom Items in MIDP 2.0 and Adding Custom Items to MIDP 2.0 Forms

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Thanks for all the clarifications, guys. In future I'll be more careful.

Anything else like this I'll just post the link.

All the best

LJ

To just post link it is not good idea, to give it some sort of description in your own words is always helpful and ensure that you are not reported for spamming.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

How did you change PATH? Did you you adjust also Java version number to reflect your installation (1.6.0_versionNum)? What operating system you have and what Java installation you used (32bit/64bit)?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Edit

PATH=C:\Program Files\Java\jdk1.6.0_12\bin;%PATH%;C:\Program Files\Java\jdk1.6.0
_12\bin;C:\Program Files\Java\jdk1.6.0_12\bin;%PATH%

to

PATH=C:\Program Files\Java\jdk1.6.0_12\bin;

Any good reason you want to create CLASSPATH?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Like this. Follow the tutorial and try out

mKorbel commented: by anonymous upvoter +8
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@pro_learner did you actually bother to check what was recommended to read on the forum. Answer is no. If you wish to participate in discussion you better to do best and read and check other members suggestions.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Then you have to write CustoItem as per your requirments

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Thanks. I will try this too . . . for home use at least. We're using Eclipse and NetBeans at work so I might as well familiarise myself with the use of it.

If you already familiar with Eclipse or NetBeans then by no means go for them. I suggested JCreator just because you said you use text editor

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

To avoid big confusion with profesional IDE, I can recommend to try out JCreator. Very simple Windows IDE for java, more of text editor with syntax highlight. Simple to use, you do not need to try create project with it, just create files in folder, compile and run

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Given the limited information nobody can be 100% sure what is wrong.
1) What database you used?
2) What driver you used?
3) What changes did you do, if any, to create database as stated in that tutorial?
4) What is exact error message?