Error SQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘?)INSERT INTO Clientes(nome) VALUES(?)’ at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:768)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:653)
at uni.jdbc.preparedStatement.Main.main(Main.java:46)

Can java SSLException: closing inbound before receiving peer’s close_notify be safely ignored?

I’m connecting to a MySQL 5.7 server from a java 1.8 app using the MySQL Connector/J 5.1.47 (2018-08-17). I know this an old version of the libary, but I need to use it because I need to also connect to a MySQL 5.5 database from the same java app, and this is the last version that I’m aware of that supports 5.5 and 5.7. I have no problems connecting to both databases, but when I try to close either of the connections, I get the following error printed to my log:

How should I get all the messages from my database and return it

I’m making a chat app with Java and I’m getting all the messages to a specific chatroom. The issue is I don’t know how to put them all in one array or something so it can be returned all at once to the user. I’ve tried just making a while loop to keep return an array, but it only returns once. I would like to try to just append all the values into one array, but I’m not really sure how to do that. All the examples I’ve seen, just add existing data like an existing array to another existing array. Please help, I’m not sure what to do.

Docker connecting to docker mysql (jdbc url)

I’ve a running MySQL database on a container that looks like this (docker-compose): version: '3' services: my-database: image: mysql:latest volumes: – ./data:/docker-entrypoint-initdb.d container_name: db command: –default-authentication-plugin=mysql_native_password environment: MYSQL_ROOT_PASSWORD: admin MYSQL_DATABASE: MYDATABASE cap_add: – SYS_NICE ports: – "3308:3306" networks: – database networks: database: external: true When I’m running my app, I use the following jdbc url … Read more