943,896 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Marked Solved
  • Views: 3073
  • JSP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 30th, 2008
-1

Re: error while forwarding page

Now here is crucial question: "Do you want to submit only average project and forget about it or you want to get best out of your project and learn something?"
If
  1. answer is I want average project and forget about it, then continue as you started. Unfortunately I do not see many members want to help with such lousy coding...
  2. answer is I want to submit best project and learn in same time, then you will take this design to Database Design section and seek advice on current state of your DB design as there are serious flows in it. For example, aren't they supposed to be same?
    CREATE TABLE markedevent
    (
     userid   int(4)  NOT NULL ,
     eventid      int(4)  NOT NULL,
      PRIMARY KEY ( userid)
    );
    
    
    CREATE TABLE  Event
    (
      Eventid     int(4)  NOT NULL  AUTO_INCREMENT,
      Description   varchar (255)  NOT NULL,
      Publish       varchar(20)   NOT NULL,
      Questionid   int(4)    NOT NULL,
      Targetgroup   varchar(70)   NOT NULL,
       Anonymous  varchar(15)   NOT NULL,
       PRIMARY KEY (  Eventid )
    );
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Jul 30th, 2008
0

Re: error while forwarding page

Hi peter_budo,
Thanks for yor post.
The highlighted column in two tables stores the same data.
Now forget about markedevent table for time being.
now if i want to restrict user against polling same questions in second times, i check userid and eventid in final output table like:
JSP Syntax (Toggle Plain Text)
  1. rs=stmt("SELECT userid FROM final where Userid='"+USERID+"'and Eventid='"+EVENTID+'""")
  2.  
if the user has polled perticular event previusly then his userid and corresponding eventid will be there in final table. if not then result of rs will be null. can i use like this?
JSP Syntax (Toggle Plain Text)
  1. if(rs==null){
  2.  
  3. shows the event for polling}
  4. else{
  5.  
  6. }
whether i am doing in right ways?
Thanks and Regards
Haresh
Last edited by peter_budo; Jul 30th, 2008 at 8:18 am. Reason: Replacing [tex] for [code] tags
Reputation Points: 8
Solved Threads: 0
Light Poster
guravharsha is offline Offline
42 posts
since Jun 2008
Jul 31st, 2008
0

Re: error while forwarding page

Hi peter_buto,
I am really interested about how to separate business logic from presentation logic.
Like you suggest me to do database connectivity with servlets or java class only.
As this is my first project, I require help from you.
Can I send my project folder with this post?
It’s really difficult to manage both this logic in jsp page with many times problem with closing scriplet.
Another one is can i write single page database connectivity code for entire project.
Thanks and Regards
Haresh
Reputation Points: 8
Solved Threads: 0
Light Poster
guravharsha is offline Offline
42 posts
since Jun 2008
Jul 31st, 2008
-1

Re: error while forwarding page

Yes you can attach compressed copy (in ZIP) of your project.
And it would be possible to have one servlet handling all, but I would advice against it (Java file with hundreds lines doesn't look pretty either ) and recommend splitting on more servlets to handle similar requests
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Jul 31st, 2008
0

Re: error while forwarding page

Hi peter_budo,
Thank you very much for your help:
Here with I am attaching copy of project folder with database.
Thanks and Regards
Haresh
Attached Files
File Type: zip student.zip (443.3 KB, 4 views)
File Type: zip mynewdatabase.zip (3.0 KB, 10 views)
Reputation Points: 8
Solved Threads: 0
Light Poster
guravharsha is offline Offline
42 posts
since Jun 2008
Aug 1st, 2008
-1

Re: error while forwarding page

OK, I downloaded files, but first I will have to re-install NetBeans as I have the simplest package for Java coding and Mobility Pack
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Aug 1st, 2008
-1

Re: error while forwarding page

For what sort of database is that zip file? Is that Derby or MySQL? If it is Derby you need to tell me how to import it and if it is MySQL then you didn't export it correctly...
The way to export from MySQL was something like this if I remember it:
  1. Open Command Prompt
  2. Got to top level of the hard disk C:\
  3. Type following command
    JSP Syntax (Toggle Plain Text)
    1. mysqldump -u YOUR_USERNAME DATABASE_NAME>FILE_NAME.sql -p
Replace sections in capital with your data and hit ENTER after "-p", where you will be asked for the password to your database. After that file with your given name and "sql" extension will be created on current directory level. So if you moved to the top as I told you it will be directly under root "C:\"
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Aug 2nd, 2008
0

Re: error while forwarding page

Hi Peter_bodu,
Sorry for late post as was not at my desk.
If you downloaded mysql database, then you can have the start window for it like-> start->programs->mysql_mysql server 5.o-->mysql command line client. otherwise you can access it in command promt window by using command
Quote ...
mysql -u userId -h Hostname -p here userId =root Hostname=localhost

Then it ask password. type password= root123
my datbase name is =mynewdatabase
Thanks and regards
Haresh
Last edited by guravharsha; Aug 2nd, 2008 at 1:32 am.
Reputation Points: 8
Solved Threads: 0
Light Poster
guravharsha is offline Offline
42 posts
since Jun 2008
Aug 2nd, 2008
-1

Re: error while forwarding page

Hi Peter_bodu,
Sorry for late post as was not at my desk.
If you downloaded mysql database, then you can have the start window for it like-> start->programs->mysql_mysql server 5.o-->mysql command line client. otherwise you can access it in command promt window by using command

Thanks and regards
Haresh
I do have MySQL on my pc, but the file you provided are in wrong format. Please run that command that I provided in previous post to get them in "sql" file
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Aug 2nd, 2008
0

Re: error while forwarding page

Hi,
Here with I am attaching the database file in you suggested format.
Thanks and Regards
Haresh
Attached Files
File Type: zip mynewdatabase.zip (21.2 KB, 9 views)
Reputation Points: 8
Solved Threads: 0
Light Poster
guravharsha is offline Offline
42 posts
since Jun 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: general questions about jsp
Next Thread in JSP Forum Timeline: Open Office document in IE browser





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC