B Vancoullie

Greenhorn
+ Follow
since May 21, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by B Vancoullie

Thanks for your book question I have massive problems using Jpackage with javafx is there any coverage on jpackaging or making fat jar files with intellij?

I just want one installable .exe file or at least 1 fat jar so i can run my program with all the dependencies included

thanks!!
3 years ago
Hi, I'm very new to JavaFX and I can run my code while viewing the scene but what if I have a task running constantly that is running in the background since startup and every time there is an update i want to update a label on a certain scene?

How am I doing this properly in JavaFX?

Thanks for helping meout.
3 years ago
Hello,

I'm really enjoying the book OCP Complete study guide, just so much fun to read something that is really up to date and well explained!

I tried to make an account at Wiley, the code that got emailed didn't work. Clicking on account new accounts gives me all kinds of options but creating an account is not in there.

I'm sorry, this is 2020, how in the world is it possible that people like Wiley are creating such a messy user experience? Wiley should hire some of their writers, this is such a horrible site.

Anyways, I'm skipping the online portion because it simply doesn't work and I'm just going to focus on the book then.

I just hate it when simple IT systems don't work. Who tests these things? Does companies know how much things cost when you contact helpdesks etc because of simple functionality not working?


Anyways, Thanks for the book, just great!
Hello,

I need to have the previous day date but excluding weekends. I tried some stack overflow but can't find what I need. I managed to get the previous day using this method:



How would I add to exclude weekends? Thank you for the help, I'm a bit stuck here.

I was thinking to check if it's Monday and then ask the date -3 days ago, is that the best way? did I just answered my own question :-)

Thanks!
4 years ago
Thanks for the replies, this makes all sense now. Seems like I need to create a database connection pool and take a connection from it and close it when done and hand it back to the pool. I'm easing into spring so I hope Spring will help me with that :-)

Cheers

4 years ago

Campbell Ritchie wrote:Please always tell us the source of such information, so we can read it for ourselves.

Sounds like something you want to do in a separate th‍read (at which point it ceases to be a “beginning” topic, so I shall add you to different fora). Not sure what you would do but find out about completable futures. One reference is Urma Fusco and Mycroft Modern Java in Action (Manning). It's also the older edition of that book, called Java8 in Action.



sorry for that

i was reading this: https://stackoverflow.com/questions/9428573/is-it-safe-to-use-a-static-java-sql-connection-instance-in-a-multithreaded-syste

"You should always acquire and close the connection, statement and resultset in the shortest possible scope, preferably inside the very same try-with-resources block as where you're executing the query according the following JDBC idiom:"

thanks
4 years ago
Hello,

I'm grabbing data from an API and I get very fast like 100 items.

I want to insert these into my database but I have no idea when the last item will be or come in.

That means that I can't make a List and then at the end insert all the data at once.

So every time I get this data (sometimes +/-100 items very fast) I would need to call a class that inserts this data immediately.

This is all fine but my question is, this call to that method in that class makes a JDBC connection, inserts data and closes the connection. So it does this 100 times very fast sequentially. I was thinking about opening 1 time a connection and then keep that connection open and just close it when the program ends. Apparently this is not done and Java coders prefer to make these connections and close them after data insertion is finished, combined with data connection pooling in some frameworks.

Is this correct? Opening and closing connections to databases so many times seem weird to me? I would have a static method that makes this connection and keep it open and then just another method that inserts data, but this apparently is wrong :-)

Thanks!
4 years ago
Hello,

So I have a Class1 that has created objects with data, and that Class1 also makes a HashMap that has a unique Identifier (id) as Key and has that Object as a value.

Then there is another Class2 that needs to update these objects with certain data. This is fine because the Class2 has the Key (id) also.

The problem is, I cannot call Class2 with that HashMap because it is an API that I use and the Class2 is another process that is running in another thread that is already started before I run Class1. So Class2 is processing incoming messages. I don't know how I can copy that HashMap into that Class2, since Class2 is up and running before Class1 creates the objects.

One solution is to have a database and update these fields by Class1, and then let Class2 update the extra data in the database using that Id (Key) but isn't that a bit overkill? What is the best way to do this?

Thank you very much for the help, I'm stuck here with my Java noob brain :-)
4 years ago

Kristina Hansen wrote:you can not create references at runtime with these: Object a, Object b, Object c,



Aha!! I had no idea this wasn't possible.

Let me learn about the maps, thank you both for your help. I had a feeling I was trying to do something wrong.
5 years ago
Hello,

I have a question I can't get my head around, thank you for helping.

I understand how to make objects but how would you create 2000 objects from a class and you read the object names from a file and you added them to a list that you can iterate to create all the objects with the names of that StringList?

I can't loop it, and do this


how do you do this? For example, I have 2000 items in a StringList and I want to create 2000 objects that have as name these 2000 String names that are in that list.

Or do you create 1 class object containing a list of these 2000 names? I'm clearly missing something here.

Each object contains certain values, that's why I would like to have 2000 objects that contains this data so i can iterate over that list and do actions on them? Is my thinking correct?

Thank you for helping.
5 years ago

Marco Behler wrote:A question for all, especially for the video critics like Les Morgan or Sean:

I have been producing quite a few Java screencasts lately ( www.marcobehler.com ) and would honestly appreciate your real opinion (yup positive or negative - also, feel free to send me a PM and I'll give you a temporary free account to watch all videos)

Thanks!
Marco



Hi Marco,

I'm one of the critics, I find that video courses are too much showing how they 'type' instead of structurally explaining what it's all about, what the concepts are. One big offender in this all is the hugely popular Tim Buchalka on udemy - with his 100.000 students. He's a master in explaining a concept in 4 spoken lines in 30 seconds and then see him go on for 1 hour of video content of him typing while you try to understand what the concept he's explaining is all about.

Good books are all about using enough sentences to explain the concept clear and complete, it's easy to re-read a page when they go deep, but how many people are going to rewind these 30 seconds to hear the few lines again that have no depth and are more like a wikipedia definition?

I just checked out your site. Eugh, okay, going to be honest here, this is quite interesting! Do you have discount code :-) LOL

Cheers
7 years ago

Jesper de Jong wrote:So, Java 9 is indeed delayed, at least until September: https://coderanch.com/t/680598/java/java-delayed-september



Auch, no bonus this year guys, sorry.
7 years ago

Jeanne Boyarsky wrote:

Jesper de Jong wrote:I think the most likely thing is, when the module system does not get accepted, is that the release of Java 9 will be delayed.

The module system is the one big feature that Java 9 is all about. Without the module system, Java 9 will be no more than a minor update.


Agreed on delays. Java 9 can't physically go out without modules without a major rewrite. Yanking it out isn't easy. So that decision would set back the schedule too. Probably more than hashing out the remaining obstacles.



Basically, for the IT publishing industry, a delay of Java9 (which will probably happen) or even the module system taken out of JAva9 doesn't look like a financial success to me.

That's like writing code for 6 months to hear that the project has came to a stop and all the hard work you've put in was useless.

Pretty crazy stuff.

Cheers
7 years ago

Jeanne Boyarsky wrote:This is a great question; have a cow.



Hey thanks and thank you for your answer.

Reading the above, this seems like a real 'horror' story so close to Java 9 release!

Do you know some publishers already printed?

Isn't it faster these days to print books like say, 20 years ago?

Cheers


7 years ago