jdbc

Google Apps Script, JDBC and MySQL does not work with Date 0000-00-00

心已入冬 提交于 2021-02-18 19:03:08
问题 I am trying to read a MySQL db record using this simple code in Google Apps Script: function testConn(){ // make the connection var connection = Jdbc.getConnection("jdbc:mysql://" + DB.URL + ":" + DB.PORT + "/" + DB.DATABASE, DB.USERNAME, DB.PASSWORD); // perform the query var SQLstatement = connection.createStatement(); var result = SQLstatement.executeQuery("SELECT date_available FROM oc_product where model = 'B23-U57-U57'"); var colNum = result.getMetaData().getColumnCount(); while(result

Kafka JDBC Sink Connector, insert values in batches

谁都会走 提交于 2021-02-18 18:50:35
问题 I receive a lot of the messages (by http-protocol) per second (50000 - 100000) and want to save them to PostgreSql. I decided to use Kafka JDBC Sink for this purpose. The messages are saved to database by one record, not in batches. I want to insert records in PostgreSQL in batches with size 500-1000 records. I found some answers on this problem in issue: How to use batch.size? I tried to use related options in configuration, but it seems that they no have any effect. My Kafka JDBC Sink

Kafka JDBC Sink Connector, insert values in batches

巧了我就是萌 提交于 2021-02-18 18:49:45
问题 I receive a lot of the messages (by http-protocol) per second (50000 - 100000) and want to save them to PostgreSql. I decided to use Kafka JDBC Sink for this purpose. The messages are saved to database by one record, not in batches. I want to insert records in PostgreSQL in batches with size 500-1000 records. I found some answers on this problem in issue: How to use batch.size? I tried to use related options in configuration, but it seems that they no have any effect. My Kafka JDBC Sink

Configuring a JNDI resource SQL in Jetty

安稳与你 提交于 2021-02-18 13:35:31
问题 I am having a lot of difficulty configuring a JNDI Resource in Jetty. I've gotten this to work in a Tomcat easily using context.xml and the Resource node. Attempts have been made to specify the resource in Jetty in both the jetty-env.xml and their version of a context.xml file but I end up getting the same exception. Here is the context.xml version of the resource definition: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse

Configuring a JNDI resource SQL in Jetty

可紊 提交于 2021-02-18 13:34:54
问题 I am having a lot of difficulty configuring a JNDI Resource in Jetty. I've gotten this to work in a Tomcat easily using context.xml and the Resource node. Attempts have been made to specify the resource in Jetty in both the jetty-env.xml and their version of a context.xml file but I end up getting the same exception. Here is the context.xml version of the resource definition: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse

How to connect XAMPP MySQL local DB using JDBC?

烂漫一生 提交于 2021-02-17 21:57:51
问题 I have this Tetris game written in Java, which uses DB to record high scores. It worked ok as long as I was using remote MySQL DB, but now I'm trying to set up localhost DB using XAMPP MySQL and it keeps going like "SQLException: Communications link failure" at command: con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost/score", user, psw); I guess it's either wrong URL or DB configuration, but I really don't know what to check. Any ideas? EDIT: My friend has fixed my problem

Servlet with JDBC [duplicate]

心已入冬 提交于 2021-02-17 07:11:47
问题 This question already has answers here : The infamous java.sql.SQLException: No suitable driver found (16 answers) Closed 3 years ago . I have a problem with my progect. Files of progect: House.class public class House implements Serializable { //properties ------------------------------------------------------------- private String price; private String square; private String RoomNumbers; //------------------------------------------------------------------------ //getters - settersm Object

Servlet with JDBC [duplicate]

穿精又带淫゛_ 提交于 2021-02-17 07:11:30
问题 This question already has answers here : The infamous java.sql.SQLException: No suitable driver found (16 answers) Closed 3 years ago . I have a problem with my progect. Files of progect: House.class public class House implements Serializable { //properties ------------------------------------------------------------- private String price; private String square; private String RoomNumbers; //------------------------------------------------------------------------ //getters - settersm Object

insert in select in MySQL with JDBC

不想你离开。 提交于 2021-02-17 06:54:05
问题 I would like to have a value from a row inserted into an other row here is my code: static void addVipMonth(String name) throws SQLException { Connection conn = (Connection) DriverManager.getConnection(url, user, pass); PreparedStatement queryStatement = (PreparedStatement) conn.prepareStatement("INSERT INTO vips(memberId, gotten, expires) " + "VALUES (SELECT name FROM members WHERE id = ?, NOW(), DATEADD(month, 1, NOW()))"); //Put your query in the quotes queryStatement.setString(1, name);

Statement cancelled due to timeout or client request

血红的双手。 提交于 2021-02-17 06:21:36
问题 I am trying to add data to my Google Cloud SQL database using Google App Script. My code was working fine last night when I finished but when I ran it this morning it is now giving me the error "statement cancelled due to timeout or client request", the error I am getting in the cloud console is "Got an error reading communication packets". Last night it was processing about 1,600 lines of data. I have played around with it and narrowed it down that the error will occur when there is more the