mysql-connector

ResultSetImpl throws NullPointerException

天涯浪子 提交于 2021-02-19 02:29:10
问题 i'm running mysql 5.5 with mysql 5.1.18 connector. a simple query of style select * from my_table where column_a in ('aaa','bbb',...) and column b=1; is executed from within java application. the query returns a resultset of 25k rows, 8 columns in each. while reading the results in while loop while(rs.next()) { MyObject c= new MyObject(); c.setA(rs.getString("A")); c.setB(rs.getString("B")); c.setC(rs.getString("C")); ... } a following exception is thrown, usually during the first loops, but

Python Module Mysql-connector Does Not See New Changes

眉间皱痕 提交于 2021-02-11 12:29:41
问题 I use mysql.connector to fetch rows in a python script but when I update a table the I don't see the changes. My code is: import mysql.connector database = mysql.connector.connect(host='localhost', user='root', passwd='password', database='my_db') cursor = database.cursor() cursor.execute('SELECT * FROM my_table') print(cursor.fetchall()) cursor.execute('SELECT * FROM my_table') print(cursor.fetchall()) In first time it reads the correct values but at the second time it reads the same values

How to install MySQL Connector for .NET C# on mac?

前提是你 提交于 2021-02-11 10:31:07
问题 How to install MySQL Connector on mac and communicate and retrieve information from the database from Visual Studio for Mac. What should you do? When I install Connector not macOS option (remember that I want to install MySQL Connector .NET ) How to do it ? I would like to thank you for every answer :) I've tried a lot of things, I do not have to do it? I expect the answer will be simple but I can not find it. Thank you in advance for any helpful answer :) 回答1: In Project -> Manage NuGet

Libs and linker with CMake and MySQL C++ Connector?

倾然丶 夕夏残阳落幕 提交于 2021-02-11 06:02:14
问题 I download the MySQL C++ Connector, I need it for a project in CLion, now, I was trying to make it run, but it was all in vain, I get the error -1073741515 (0xC0000135), i've read that is about a linking or lib problem. My current CMake: cmake_minimum_required(VERSION 3.6) project(Entrenamiento CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_FLAGS "-Wall") set(SOURCE_FILES main.cpp) set(Entrenamiento_VERSION_MAJOR 1) set(Entrenamiento_VERSION_MINOR 0) add_library(mysqlcppconn SHARED IMPORTED)

Libs and linker with CMake and MySQL C++ Connector?

霸气de小男生 提交于 2021-02-11 06:01:17
问题 I download the MySQL C++ Connector, I need it for a project in CLion, now, I was trying to make it run, but it was all in vain, I get the error -1073741515 (0xC0000135), i've read that is about a linking or lib problem. My current CMake: cmake_minimum_required(VERSION 3.6) project(Entrenamiento CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_FLAGS "-Wall") set(SOURCE_FILES main.cpp) set(Entrenamiento_VERSION_MAJOR 1) set(Entrenamiento_VERSION_MINOR 0) add_library(mysqlcppconn SHARED IMPORTED)

MySql: Inserting python lists into a table

烂漫一生 提交于 2021-02-10 17:48:49
问题 How do I insert these 2 lists into different SQL columns of the same table a = [1,2,3] b = [4,5,6] This is the way to insert one list into a column query = "INSERT INTO tableName (col1) VALUES (%s)" cursor.executemany(query, [(r,) for r in a]) I can't seem to figure out how to insert both the lists into the table, I want list a to be in one column and list b to be in other column 回答1: query = "INSERT INTO tableName (col1, col2) values (%s, %s)" cursor.executemany(query, [(x, y) for x, y in

MySql: Inserting python lists into a table

瘦欲@ 提交于 2021-02-10 17:45:35
问题 How do I insert these 2 lists into different SQL columns of the same table a = [1,2,3] b = [4,5,6] This is the way to insert one list into a column query = "INSERT INTO tableName (col1) VALUES (%s)" cursor.executemany(query, [(r,) for r in a]) I can't seem to figure out how to insert both the lists into the table, I want list a to be in one column and list b to be in other column 回答1: query = "INSERT INTO tableName (col1, col2) values (%s, %s)" cursor.executemany(query, [(x, y) for x, y in

How do I retrieve an out parameter from a MySQL Stored Procedure in Python using MySQL-Connector?

自闭症网瘾萝莉.ら 提交于 2021-02-08 09:49:42
问题 I'm having trouble accessing an out parameters values from a stored procedure in MySQL(8x) using Python(3.7) and sql connector (8x). My stored procedure is an update procedure and it is working, however I don't know how to get the out value in code. Here is my stored procedure...I simply want to access the out parameter named success in python. CREATE DEFINER=`root`@`localhost` PROCEDURE `update_due_date`(param_bookId int, param_cardNumber int, param_dueDate date, out success int) BEGIN

How to fetch DateTime from mysql using xdevapi

梦想与她 提交于 2021-02-07 09:26:53
问题 When I select a dateTime field, it gets returned as 6 bytes. How can I convert it to a time_point or struct tm? mysqlx::Session session( "mysqlx://root:password@127.0.0.1:33060/catalog" ); auto row = session.sql( "select create_time from information_schema.tables order by 1 LIMIT 1" ).execute().fetchOne(); assert( row[0].getType()==8 );//raw type assert( row[0].getRawBytes().second==6 );//6 bytes var bytes = row[0].getRawBytes().first; //e2 0f 08 0c 0a 32 //2018-08-12 10:50:04 回答1: Hey I just

How to fetch DateTime from mysql using xdevapi

我怕爱的太早我们不能终老 提交于 2021-02-07 09:26:36
问题 When I select a dateTime field, it gets returned as 6 bytes. How can I convert it to a time_point or struct tm? mysqlx::Session session( "mysqlx://root:password@127.0.0.1:33060/catalog" ); auto row = session.sql( "select create_time from information_schema.tables order by 1 LIMIT 1" ).execute().fetchOne(); assert( row[0].getType()==8 );//raw type assert( row[0].getRawBytes().second==6 );//6 bytes var bytes = row[0].getRawBytes().first; //e2 0f 08 0c 0a 32 //2018-08-12 10:50:04 回答1: Hey I just