I have a user who has an expiration date (dateTime), I need to display all users who have not expired yet. Tried different options with DATA (), or as an example – but it doesn’t output anything. But when asked in MySQL – SELECT * FROM user where user.date> NOW () displays everything as it should. Tell me how to
Tag: database
How to connect to IntelliJ Ultimate’s LocalHost MySQL database?
I went to Database > + > Data Source > MySQL Here’s what my panel looks like: This is the error: and here’s my connection file: What could be my problem? I tried searching up for what others have tried but none of them seemed to work and I had to make several copies of my entire project because I
Java H2 Mixed mode (embedded and server) external connection
I am trying to convert my existing embedded H2 database and enable external connections to it. Currently my properties are For a local connection to my db in this mode I seem to be able to connect to “jdbc:h2:file:./db;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9090” through my intellej IDE. If this database is hosted on a external server how do i connect to it? I have
How to write a query to get distinct values from mongodb collection?
I need to get distinct values from a collection. Those data is in a field of a collection. It means I need to get set of name from the user collection.I tried it using cmd and I get the result as I need. But I can’t understand how to write the query in the spring file.Since I’m new to java
Converting Date and Gender to String using Apache-poi [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question How can I set Date and Gender that is in the database? Answer To write Date and Gender in Cell you need to convert them
MongoTimeoutException: No Server Match – MongoDB Atlas
For a few days now, I can’t connect to any of my MongoDB Databases that are hosted by Altas. I’m always getting a MongoTimeoutException Line 233-235 in Main Here is the class where I connect to the Database I replaced the user, password and database for this post. I already checked everything twice. The IP is whitelisted, the connection server
Java spring Hibernate : Error when trying to implement a many to one relationship
I am trying to implement a many to one relationship with a user being able to have many posts. The used database is postgresql. The error I have is the following and is caused by Hibernate: alter table post drop constraint FKl1p5mt95jngsghp4vtaw04egh : These are the 2 classes I use : and The error occurs at the initialisation of the
Required character converter is not available. ERRORCODE=-4220, SQLSTATE=null
The application I migrate to Java8 was running on Java7. After the migration i had to update the db2jcc.jar to latest version and yet I have the error below: I have checked and tried the topic Getting error code 4220 with null SQL State Has anyone faced this before? Regards Answer Your question included The exception text included: Notice the
Do foreign keys in apache derby automatically populate a column?
Recently I’ve been trying to create a RDB, and the problem I’m running into is that the columns I have with a foreign key constraint will not populate with the values of the referenced column (it will have null values). The only way I’ve managed to have the correct values is to populate it manually. I will say, however, that
How close possibility to add new data in H2?
I have a problem. After adding some data to database, I need to set read-only mode for whole DB. What is the easiest way to do that using h2 embedded DB with driver manager (jdbc)? Answer You can open the whole database in read-only mode by appending ;ACCESS_MODE_DATA=r to the JDBC URL (“jdbc:h2:” + “./” + dbName + “;ACCESS_MODE_DATA=r” in