The Student Room Group

FREE Programming/Coding Help Desk

Scroll to see replies

Reply 380
Original post by Andy98
Yeah the principle would be the same, but if it was VB I'd be able to give an example

Posted from TSR Mobile


Oh :frown: - I've never used VB
only language I've ever used it Java :tongue:
Original post by z33
Oh :frown: - I've never used VB
only language I've ever used it Java :tongue:


Right, well when you connect to the database you copy all the necessary contents into a dataset. That should be done when the page loads. When the user inputs data, after ensuring it is in the correct format search through the dataset to make sure the primary key isn't already in there.

If it isn't in there add a new record, if it is in there add the new data to the relevant record

Posted from TSR Mobile
Reply 382
Original post by Andy98
Right, well when you connect to the database you copy all the necessary contents into a dataset. That should be done when the page loads. When the user inputs data, after ensuring it is in the correct format search through the dataset to make sure the primary key isn't already in there.

If it isn't in there add a new record, if it is in there add the new data to the relevant record

Posted from TSR Mobile


oh right soooo I had no idea what you meant
looked around for tutorials but still didn't get anything so decided to actually program it and found this :O
primary key.png
there's a primary key checkbox!! if I check it does that mean the name becomes the primary key or am i trippin 0_0?
Original post by z33
oh right soooo I had no idea what you meant
looked around for tutorials but still didn't get anything so decided to actually program it and found this :O
primary key.png
there's a primary key checkbox!! if I check it does that mean the name becomes the primary key or am i trippin 0_0?


Aye, also if you click unique it makes sure every name is different

Posted from TSR Mobile
Reply 384
Original post by Andy98
Aye, also if you click unique it makes sure every name is different

Posted from TSR Mobile


oH MY GOSH PROGRESS YES isdfjoijfwe d:jumphug::jumphug::jumphug:
I LOVE YOU THANK YOU :biggrin: :h:

Spoiler

Original post by z33
oH MY GOSH PROGRESS YES isdfjoijfwe d:jumphug::jumphug::jumphug: I LOVE YOU THANK YOU :biggrin: :h:


Hahaha, I'm not that good:tongue:

Although if you're serious I am on the market:wink::tongue:

Posted from TSR Mobile
Original post by Andy98
Aye, also if you click unique it makes sure every name is different


But don't forget two people can have the same name. :wink:
Original post by Push_More_Button
But don't forget two people can have the same name. :wink:


Of course, hence why I'd use some other identifier:wink:

Posted from TSR Mobile
Reply 388
Original post by z33
um... no ._.

Spoiler




if txtName.getText().trim().isEmpty() {

}


For each of the controls you have just check to see if they contain a value. So for example a JComboBox/ListView just check the selected index is greater than -1.

Most validations is done using if statements and regex from my experience.
Reply 389
Original post by Andy98
x


okay just to be sure - do i add a column in the database table for something that's gonna be autofilled?
the average score is going to be automatically calculated so no user input is required but it does need to be stored for the student :/

also - if i wanted to store the date the quiz was taken and made the datatype 'Date' where do I specify the format (dd.MM.yyyy)
in check? or default? or not in the mysql table at all :O?
Original post by z33
okay just to be sure - do i add a column in the database table for something that's gonna be autofilled?
the average score is going to be automatically calculated so no user input is required but it does need to be stored for the student :/

also - if i wanted to store the date the quiz was taken and made the datatype 'Date' where do I specify the format (dd.MM.yyyy)
in check? or default? or not in the mysql table at all :O?


Well it depends; you can either store it and recalculate each time that record is edited, in which case yes you would.
OR, you can just calculate it when the user requests to see it, in which case no.

The datatype specifies the format; dates are always stored in that manner.
Reply 391
Original post by Andy98
Well it depends; you can either store it and recalculate each time that record is edited, in which case yes you would.
OR, you can just calculate it when the user requests to see it, in which case no.

The datatype specifies the format; dates are always stored in that manner.


Oh right - it's gonna be shown on the page so i think i'll store it

oh right thanks :biggrin:
Original post by z33
Oh right - it's gonna be shown on the page so i think i'll store it

oh right thanks :biggrin:


No problemo
Hey guys,

I'm doing the F454 project and Im really stuck. Not coding wise, but decision wise. Like Im making a personal finance program for a group of entrepreneurs in which will include things such as Net Worth Calculator, Income Calculator, Budget Calculator, Notes section, Reports, RSS Reader to get latest Personal Finance news. The Calculators will include a graphing system in which I can save and remove previous Net Worths, Budgets and incomes as well as just calculating it.

So.. whats the problem? I go on OCR website and I find someone has done the most laziest programming Ive ever seen (not even a database lol) and they got 74/80. The question is... Am I overdoing it? Like I was doing everything is SQLite but then I realised I cant connect to a server with SQlite so Im switching to MySQL. Should I continue doing what I'm doing or should I just write everything to a text file just like the OCR Exemplar. Really don't know what to do.
Original post by UnknownDude
Hey guys,

I'm doing the F454 project and Im really stuck. Not coding wise, but decision wise. Like Im making a personal finance program for a group of entrepreneurs in which will include things such as Net Worth Calculator, Income Calculator, Budget Calculator, Notes section, Reports, RSS Reader to get latest Personal Finance news. The Calculators will include a graphing system in which I can save and remove previous Net Worths, Budgets and incomes as well as just calculating it.

So.. whats the problem? I go on OCR website and I find someone has done the most laziest programming Ive ever seen (not even a database lol) and they got 74/80. The question is... Am I overdoing it? Like I was doing everything is SQLite but then I realised I cant connect to a server with SQlite so Im switching to MySQL. Should I continue doing what I'm doing or should I just write everything to a text file just like the OCR Exemplar. Really don't know what to do.


Do you think you can finish it your way before the deadline? If so I can't see any harm

Posted from TSR Mobile
Original post by Andy98
Do you think you can finish it your way before the deadline? If so I can't see any harm

Posted from TSR Mobile


It's not really about if I can finish it before the deadline or not. It's whether I'm doing the right thing. If I can just create a simple application (no database, just GCSE programming code) and get at least 75/80 why would I stress myself and create a really good programming whilst I could be doing my other subjects like Maths, Further Maths or Physics.. or even revise for F453.
Original post by UnknownDude
It's not really about if I can finish it before the deadline or not. It's whether I'm doing the right thing. If I can just create a simple application (no database, just GCSE programming code) and get at least 75/80 why would I stress myself and create a really good programming whilst I could be doing my other subjects like Maths, Further Maths or Physics.. or even revise for F453.


Because if it's like the project I'm doing you could get a job out of it :tongue:

Posted from TSR Mobile
Original post by Andy98
Because if it's like the project I'm doing you could get a job out of it :tongue:

Posted from TSR Mobile


Have a look at this:

http://www.ocr.org.uk/Images/269251-f454-exemplar-candidate-work-project-b-high-band-.pdf

See how simple the program is? No Database. Just code and design which you could do in a day or 2 without any understanding. Should I do the same or should I go and do stuff like mysql.
Reply 398
Original post by UnknownDude
x


OCR buddy :biggrin: :five:

NOT EVEN A DATABASE?!?! smh :colonhash:

yeah the marks aren't for the programming they're for the planning so if you think you can hit all the marks taking the easy route go for it! also could you link this for me because getting kinda suicidal with this MySQL **** 0_0

Also

SOMEONE HELP IT'S GIVING ME AN ERROR AND I CAN'T FIX IT T_T
error.jpg

i dont get it... ._.

don't even know what code to copy to show X'D there's no errors in compilation just when you click add student
Attachment not found
code got ****ed up

take 2:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
String url = "jdbc:derby://localhost:1527/StudentScores ";
String username = "admin3";
String password = "admin3";

Connection con = DriverManager.getConnection(url, username, password);
Statement stmt = con.createStatement();

String Query = "INSERT INTO STUDENT (NAME, DATEOFQUIZ, MEMORYSCORE, COMPREHENSIONSCORE, PROBLEMSOLVINGSCORE, AVERAGEPERCENTAGE)
VALUES ('"+NameText.getText()+"','"+DateText.getValue()+"','"+MemoryScoreText.getText()+"','"+ComprehensionScoreText.getText()+"','"+ProblemSolvingScoreText.getText()+"', '"+AveragePercentageText.getText()+"':wink:";

JOptionPane.showMessageDialog(null, "Student Added":wink:;
NameText.setText(null);
DateText.setText("00/00/0000":wink:;
MemoryScoreText.setText(null);
ComprehensionScoreText.setText(null);
ProblemSolvingScoreText.setText(null);
AveragePercentageText.setText(null);
}

catch(SQLException ex)
{
JOptionPane.showMessageDialog(null, ex.toString());
}
}
(edited 8 years ago)
Original post by UnknownDude
Have a look at this:

http://www.ocr.org.uk/Images/269251-f454-exemplar-candidate-work-project-b-high-band-.pdf

See how simple the program is? No Database. Just code and design which you could do in a day or 2 without any understanding. Should I do the same or should I go and do stuff like mysql.


That's hideous:eek:

I would continue your way

Posted from TSR Mobile

Quick Reply

Latest

Trending

Trending