TomasGnG 😴
TomasGnG 😴
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by TomasGnG 😴 on 10/19/2024 in #java-help
SQLite driver not found with OrmLite
No description
21 replies
JCHJava Community | Help. Code. Learn.
Created by TomasGnG 😴 on 9/22/2024 in #java-help
Download a file with its given name
Normally if you want to download a file through your browser, the browser asks you for the destination path and the name of the file is already given. Now I want to download a file with that specific filename. How can I do that?
26 replies
CC#
Created by TomasGnG 😴 on 7/3/2024 in #help
ASPX Website: URL is getting cut by the browser because it seems too long
I dont have the code right now because that was at work but the aspx website was for redirecting to an internal archive website where I can create search parameters for documents. In the end the url was 2000 chars long or something and was always getting cut by the browser (tested with firefox, chrome and Microsoft Edge). What could I do to bypass that url length limit? Afaik the code was this:
var redirectLink = CreateRedirectLink(...);
Respone.Redirect(redirectLink, false);
var redirectLink = CreateRedirectLink(...);
Respone.Redirect(redirectLink, false);
Please @ me when you answer, thanks.
12 replies
JCHJava Community | Help. Code. Learn.
Created by TomasGnG 😴 on 3/21/2024 in #java-help
SQL Exception when running Minecraft plugin
So I have this sql script
CREATE TABLE IF NOT EXISTS players (
id INT AUTO_INCREMENT,
name VARCHAR(16) NOT NULL,
uuid VARCHAR(36) NOT NULL,
PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS friendsystemSettings (
id INT AUTO_INCREMENT,
playerID INT NOT NULL,
friendrequests BOOLEAN NOT NULL DEFAULT '1',
messagesfromstrangers BOOLEAN NOT NULL DEFAULT '1',
PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS friendsystemPlayertofriend (
id INT AUTO_INCREMENT,
playerID INT NOT NULL,
friendID INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS players (
id INT AUTO_INCREMENT,
name VARCHAR(16) NOT NULL,
uuid VARCHAR(36) NOT NULL,
PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS friendsystemSettings (
id INT AUTO_INCREMENT,
playerID INT NOT NULL,
friendrequests BOOLEAN NOT NULL DEFAULT '1',
messagesfromstrangers BOOLEAN NOT NULL DEFAULT '1',
PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS friendsystemPlayertofriend (
id INT AUTO_INCREMENT,
playerID INT NOT NULL,
friendID INT NOT NULL,
PRIMARY KEY (id)
);
When I use the IntelliJ SQL console and execute it there, everything works fine. But when I try to execute it via PreparedStatement then it shows an error in the console..
String sql = "See SQL above";
PreparedStatement stm = getConnection().prepareStatement(sql);
stm.executeUpdate();
stm.close();
String sql = "See SQL above";
PreparedStatement stm = getConnection().prepareStatement(sql);
stm.executeUpdate();
stm.close();
Error
Caused by: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: (conn=943) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS friendsystemSettings (
...' at line 8
at de.tomasgng.b..
Caused by: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: (conn=943) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS friendsystemSettings (
...' at line 8
at de.tomasgng.b..
17 replies
CC#
Created by TomasGnG 😴 on 10/30/2023 in #help
❔ How do I draw correctly on a PictureBox
No description
8 replies
CC#
Created by TomasGnG 😴 on 10/26/2023 in #help
❔ How to properly sort Tasks with dependents?
So I have a program where a user can write a text file with unlimited tasks (id, name, time and depends) which will be then serialized by the program. After the program read all correctly formatted tasks it will put all the tasks in a DataGridView but now I dont know how to sort the tasks. Sorting: 1. Tasks that doesnt need any other tasks to be done 2. Tasks that have to be done for xy task
5 replies