Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!

alex moran

Greenhorn
+ Follow
since Jul 05, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by alex moran

Hey All !

I have this this method for save and update student but It whenever I save student into database and hit getAllStudent it dosen't get back the last student I already have saved ?
please help?
Hey All !

I have this this method for save and update student ,whenever I save student into database and hit getAllStudent it dosen't get back the last student I already have saved ?
please help?

Zachary Griggs wrote:Are you closing the SqlConnection at some point?

Can you post the source code of what you are doing?




No I am not closing sql connection not working in  MYSQL MAC OS although window works without isssue..it's jhipister config datasource:
   type: com.zaxxer.hikari.HikariDataSource
   url: jdbc:mysql://localhost:3306/xxxx?useUnicode=true&serverTimezone=UTC
   username: root
   password: root
   hikari:
     poolName: Hikari
     auto-commit: false
     data-source-properties:
       cachePrepStmts: true
       prepStmtCacheSize: 250
       prepStmtCacheSqlLimit: 2048
       useServerPrepStmts: true
       connectionTimeout: 3000
       
 jpa:
   database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
   database: MYSQL
   show-sql: false
   properties:
     hibernate.id.new_generator_mappings: true
     hibernate.connection.provider_disables_autocommit: true
     hibernate.cache.use_second_level_cache: true
     hibernate.cache.use_query_cache: false
     hibernate.generate_statistics: false
     hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory
     hibernate.cache.hazelcast.instance_name:zzz
     hibernate.cache.use_minimal_puts: true
     hibernate.cache.hazelcast.use_lite_member: true








3 months ago
HeY ALL

I got this exception liquibase.exception.DatabaseException: java.sql.SQLException: Connection is closed for mysql hibernate spring boot ?
 : Could not release lock

liquibase.exception.LockException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: Connection is closed

And I got one table inserted inside schema  which is databasechangelock
ANY help?
3 months ago

Paul Clapham wrote:

Mike Simmons wrote:I think the only "EST" that corresponds with UTC+2 is "Egypt Standard Time".  Is that what you meant?



I was thinking that the OP meant "EEST" -- Eastern European Standard Time -- but I see that's actually UTC+3. But anyway the issue is more of "Why not UTC?" that "Why this time zone and not that one?"



yes somehow I solved it by spring.jpa.properties.hibernate.jdbc.time_zone= UTC+3. in yml prop


thanks
3 months ago

Junilu Lacar wrote:Also, are you certain you need EST? What happens when you're in Daylight Saving Time (EDT)? Would you still store date/time values as EST?



I need to store it on  UTC +2 time in sql server not UTC
3 months ago
hello

I have a class with @audit when ever I store an object in Microsoft SQL it stores it in UTC time but I  need to store in Local Time UTC +2 ?



3 months ago
Hi all;
I passed SCJP 6 .Should I upgrade to SCJP 7 or it is better to get new certification like JSP Servlet in order to increase my chance to get a job as software java developer?
I am currently student and will graduate next semester(USA)

Thanks In Advance
Same thing with me I can see the result but can't see my certification report
please help?

Sergej Smoljanov wrote:

Thank you but I mean how can the search for index become -2 or -3 in my Testclass ?
As the question for mock exam is

What are values program can print when run?
values from -3 to 5


My question is how -3 and -2???
Hi all ,
How the index for the class below return -2 or -3 in searching for the key ? like what?
for example:
java TestClass a------> 0
java TestClass aa------> 1
java TestClass aaa------> 2
java TestClass aaaaa------> 3
java TestClass " "------> -1
java TestClass b------->-5
java TestClass ???------> -2
java TestClass ???------> -3
java TestClass bb----------->-5
java TestClass bbbb------>-5

Thanks in Advance



Henry Wong wrote:

alex moran wrote:



Line 57 of your code replaces the account object that was passed into the constructor... so, you have a race condition happening. If the second thread to replace the account object is able to do it *before* the first thread that replaced the account is able to use it, then the two threads are using the same account object (and hence, the output should be one thread and then the other). If not, then the two threads are using different account objects, and hence, the output should be mixed.

Henry



got it
Thank you




Hi all
with the code above code I got non synchronized output but when I put a=new account(); either after main directly or before t1.start() I got synchronized output ?? Is that because t1 Thread got different object than t2 although they are static (thread gets its own copy of local object)?

like that

public static void main(String[] args)
{
a=new account();

Koko t1 =new Koko(a);
Koko t2 =new Koko(a);

t1.start();
t2.start();
run:
child threadThread-0
child threadThread-0
child threadThread-0
child threadThread-0
child threadThread-0
child threadThread-1
child threadThread-1
child threadThread-1
child threadThread-1
child threadThread-1
}



Thanks in Advance

Henry Wong wrote:

alex moran wrote:
Hi ...How does the output for hashcode order determined ???



First, the hashCode() method has a capital "C" -- so you didn't override the hashcode.

To answer your question, with hashing containers, the goal is to achieve distribution of the elements, which of course, gets better big O in getting and setting. If you want a map with an order, consider using a sorted map or a linked hash map.

Henry



Thank You after editing the The result is {6 =C, 16 =F, 5 =A, 15 =D, 2 =B, 23 =E}
but still not understood how the elements are sorted according to integers ???