Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android forum!

Daniel Demesmaecker

Rancher
+ Follow
since Sep 14, 2017
Daniel likes ...
Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
After being in deadend jobs for many years, I descided to go back to school. I graduated from Intec Brussel and got my bachelor in informatica-Java development.
Currently I'm employed with the Belgian gouvernment and work for the
Ministry of Internal Affairs as webmaster
Belgium
Cows and Likes
Cows
Total received
6
In last 30 days
0
Total given
0
Likes
Total received
40
Received in last 30 days
2
Total given
10
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Demesmaecker

The main problem wasn't the architecture of the program, it was the db used.
For developing and testing purposes I used a db from db4free.net.
Now I'm using a local mysql db and it's mutch faster
23 hours ago
@Tim: It was indeed a mysql database

[quote = Dave Tolls]  ETA: Also, I don't think you need the first row as the loader uses the column order from the table definition.

That dosn't make a difference, I ignore the first line, cause Included my column headers in my csv file, but beside that, you were right about the '""', so thanks a bunch.
Most likely this isn't the right forum to ask this question, but since there isn't an better one to suite my needs, I'll give it a try.
The person fo whom I writting this program used to keep all his dat in an excelsheet.
I normalized the file and created seperate tables.
Now I would like to load the exsisting data in to the db, but already when filling the first table something goes wrong.
I seperated the needed fields in an seperate xls file and created an csv file from it.
But when executing the statement and checking my db if it loaded correct I noticed that everyting is filled with null values.
Anyone an idea how come?

The query I used:


The csv-file:


I included a printscreen of the result too
To start with my startup takes way longer when it's compiled in to a jar then when i run it from  my intelij...
That's what extracting the jar's suposed to fix. According to this post on stack-overflow
The rest I might know how to solve, as you confirmed my suspicion that the calls to the db might be the problem.
I have one main Entity who has a one to one relationship with all the other entities, eather direct or through a different entity.
I use jpa repositories and only created one for general.
So when I need an invoiceMethod, I have to go:


And that for every method. I guess it would be faster to asign the entity to a variable and call the method from there or create a own repositorie alltogether.
4 days ago
Hi guys (and girls)

I'm looking for some tips to speed up the performance of my javafx/springboot standalone application.
Online I saw I should extract my jars instead of packaging them. I don't really know how to do that, but if I understood right, I'm already doing that.



My guess is I call the database to mutch and have to mutch classes that call other classes.

Can I post here a link to a gitrepository for codereview or is that not done?
4 days ago
The easiest way would be to create an wrapperclass. Put you're result in an observable list and use this list to populate your table.
5 days ago

Tim Moores wrote:
I know little of the Spring mechanisms involved, but an HTTP redirect will always be a GET, not a POST. Does Spring not have some kind of forwarding mechanism that obviates the need of an HTTP-level redirect?



You're kinda right, I tried forwarding instead of redirecting, but then the postmethod is directly called, whithout showing the form first.
The invoiceObject is created and saved to the db, but the user dosn't get the chance to fill in the fields.
How do I call the getmethod first to show the file, while still being able to post it afterwords, it seems to be one or the other
2 weeks ago
There is a Getmethod, which bind the model with the entity and returns the form to fill the fields.
From in that form when I submit, it should call the postmethod...
3 weeks ago
That didn't really answer my question, not by a long shot.
I know how to redirect, my question was and remains if I redirect how come my postmethod isn't called when I submit the form.
3 weeks ago
It's the one with action that isn't posting, it dosn't need the action attribute if you specify the method, the eonly reasson I put in the action is cause it wasn't posting and hope that would make a difference, but it didn't
3 weeks ago
Adding the form in the generalpostmethod and redirecting instead of just calling the new form takes care of the bean problem, but still when posting the second form, the postmethod of the invoicecontroller isn't called.
3 weeks ago
That dosn't work.
And yes my wrapperform uused to populate the general and address table loads properly and the postmethod also works. The data is being saved correctly. But if I simply redirect to the next form from my postmethod, the next form isn't added as a n attribute to the model. I wrote the reasson here for is cause I redirect it myself spring dosn't create a bean.
And what configuration, spring boot does all the configuration, I've done just some basicstuff in application.properties
3 weeks ago
This question is a follow up question for: Old Question on coderanch, but since it's basicly a different question I opened a new post.

I descided to go in an other direction and seperate the forms to use their own controller, simply cause I think it's better practice.
They way I see it the wrapperform which contains the data for the General- and addresstable is called first, in the controller the generalobject is being created and saved to the db, then I redirect from that controller to the next form, where the last entry of the Genr
eraltable is queried and updated with the new entity.

But if I call the next form by the name of the jsppage the Form isn't added as a modelattribute and I get an error telling me that there is neither a bindingresult nor a modelattribute for the form.

If I put the getmethod of the next form in the previous controller en call the method instead of the jsppage, the view is shown, so I'm being redirected, but my post method dosn't work anymore.

I could fix this by using a menu to open each new form, but I don't feel like that's verry userfriendly and there's room for falsdata by the user.

How to I redirect from one controller to the next without using a menu or a button to call the new controller?

I Once again included the code.

GeneralEntity:


Invoice.jsp:


GeneralController:


InvoiceController:


GeneralRepo:


I didn't include newRecord.jsp since the first form correctly saves to the address- and generaltable
3 weeks ago
The spring.mvc.view.prefix in my application.properties is specified as "/WEB-INF/jsp/", so no additional "/" needed
3 weeks ago
They're on seperate pages. I don't really know what you mean with you remark. Apperently I cant, that is what I have bin trying...
3 weeks ago