Linked Questions

10 votes
3 answers
26k views

My jdbc driver for mysql db is of version 5.1.25. I want to execute sql query like so: statement.execute("select fullName from user where user_id=1; select fullName from user where user_id=2"); And ...
2 votes
2 answers
13k views

I am trying to write simple Java web application to get data from a database. I need to run several select queries on different database tables. String queryOne = "select firstname from employees ...
Sean Kilb's user avatar
  • 979
0 votes
0 answers
4k views

This is my SQL code, a simple transaction. When I run it on MariaDB using run as script it works well, but it doesn't work with run as SQL Statement. START TRANSACTION; SELECT * from employee; insert ...
Janki's user avatar
  • 31
0 votes
1 answer
1k views

This is my SQL code, a simple transaction. When i run it on phpmyadmin it's work well. START TRANSACTION; SELECT received_money FROM bank_accounts WHERE `uuid` = "2eaef3e4-eeb6-41f7-9ecf-...
Luluxe's user avatar
  • 13
-1 votes
1 answer
1k views

String query = "INSERT INTO St (id) values ('Admin'); " + "select * from Student where id in (select id from St);"; Getting error if try to execute the above query Exception in thread "...
2 votes
1 answer
901 views

There is a database that holds music - artists, albums and tracks. Each album has several tracks, each track has it's own track_number inside the album. I try to execute an SQL request that shifts one ...
0 votes
1 answer
380 views

I'm using JDBC to make my Java application handle SQL statements to my MySQL database. For some reason it can't do multiple insert statements in one executeUpdate() method. My code looks like this: ...
Laustrup's user avatar
1 vote
0 answers
330 views

My objective is to be able to run Descriptive Statistics mySQL queries on my tables on Java. Some of these queries consist of several parts to get one result such as getting a median of a column which ...
thatOneGuy's user avatar
1 vote
3 answers
228 views

I have a script that needs to insert multiple things inside one statement, like sql = "INSERT INTO `table` (something, something) VALUES (smth,smth); INSERT INTO `table` (something, something) VALUES ...
PaaPs's user avatar
  • 403
1 vote
0 answers
95 views

In MySQL Connector/J 5.1.39 there was com.mysql.jdbc.jdbc2.optional.MysqlDataSource.setAllowMultiQueries() to allow multiple statements in SQL queries. In new version 6.0.4 MysqlDataSource is moved ...
3 votes
0 answers
94 views

I want to remove the duplicate records from mysql db. And tried below query which will do as expected by manually. But I just want to execute this from JDBC, but It throws exception. Query: CREATE ...
ArrchanaMohan's user avatar
0 votes
0 answers
72 views

I have the following SQL script (stored in a .sql file) imported into my java program as a string (I changed some variable names so its easier to read): SET @variable1 := ( //setting the value of ...
Gtomika's user avatar
  • 885
0 votes
0 answers
46 views

I'm executing a script through a Java web service I wrote to execute on a MySQL database. When executing the query in phpMyAdmin it completes successfully, however as soon as it is executed by my web ...
0 votes
1 answer
42 views

so i was trying to run these lines of code public void refresh() { try { String strUpdate = "SET SQL_SAFE_UPDATES = 0; \n" + "delete from ...
Quang Pham's user avatar
1 vote
0 answers
26 views

Can somebody explain what I am doing wrong. I want to make table from JDBC, I executed the query in MySQLWorkBench works fine. When I want to execute it from JDBC constant gives ...
MrNobody's user avatar
  • 665

15 30 50 per page
1
2 3 4 5