Entries list

MariaDB Connector/Java You need to set exactly 1 parameters on the prepared statement

Exception in thread "main" java.sql.SQLException: You need to set exactly 1 parameters on the prepared statement
Query is : INSERT INTO my_table (my_col) VALUES ('m_val')null;
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: You need to set exactly 1 parameters on the prepared statement
Query is : INSERT INTO my_table (my_col) VALUES ('m_val')null;

Lire la suite

sql occurence char count

Comment compter le nombre d’occurrence d'un caractère dans une colonne ?

SET @string = "Bonjour ""Mr Vinal""; il fait beau l'été, l'automne et l'hivers, n'est ce pas ?";
SELECT 
SUM( LENGTH(@string ) ) AS total_length,
SUM( LENGTH(@string) - LENGTH(replace(@string, ',', '')) ) AS coma_virgule, 
SUM( LENGTH(@string) - LENGTH(replace(@string, '''', '')) ) AS quote_cote, 
SUM( LENGTH(@string) - LENGTH(replace(@string, '"', '')) ) AS double_quote_cote, 
SUM( LENGTH(@string) - LENGTH(replace(@string, ';', '')) ) AS semicolon_point_virgule
;
/*
+--------------+--------------+------------+-------------------+-------------------------+
| total_length | coma_virgule | quote_cote | double_quote_cote | semicolon_point_virgule |
+--------------+--------------+------------+-------------------+-------------------------+
|           79 |            2 |          4 |                 2 |                       1 |
+--------------+--------------+------------+-------------------+-------------------------+
*/

Lire la suite

Prévision météo à 3 mois

Les prévisions météo à 3 mois ou plusieurs mois sont plus communément appelée les prévisions saisonnières. On les retrouve par exemple sur : lachainemeteo climatologie Également, à plus court terme, les prévisions mensuelles de meteofrance.

Android Studio - UNEXPECTED TOP-LEVEL EXCEPTION com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

:app:dexDebug
AGPBI: {"kind":"simple","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","sources":[{}]}
AGPBI: {"kind":"simple","text":"com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:161)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:188)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.run(Main.java:277)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.main(Main.java:245)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.Main.main(Main.java:106)","sources":[{}]}


 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Lire la suite