Questions tagged as 'java'

3
answers

array without repeated numbers

My program consists of the following: We generate an array of 10 positions with random numbers from 1 to 20, then with a method called repeated we check that the numbers that have been generated are not in the array, in case they are on and g...
asked by 17.05.2018 / 09:02
2
answers

Unknown host exception Android

My app consumes a web service every time it detects an entry to a Geofence, but sometimes the mobile data is off or is wrong because of the signal and when sending sends a UnknownHostException , but I would like it when I have it again dat...
asked by 13.09.2017 / 03:17
1
answer

How to concatenate using StringBuilder?

I have the following method toString of a class public String toString(){ return "Solicitud [idSolicitud=" + idSolicitud +", numCifra=" + numCifra +", usuarioBD=" + usuarioBD +"]"; } and what I want is to concatenate with StringBuilder...
asked by 12.07.2018 / 18:04
1
answer

Error creating a table with primary key composed of Hibernate

I'm trying to create a table with a composite key in Spring using Hibernate, what happens is that I get the following error:    2017-09-14 09: 07: 55.323 ERROR 9108 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaUpdate: HHH000388: Uns...
asked by 14.09.2017 / 14:30
1
answer

I can not add a record to my database, mark error PreparedStatement [duplicated]

I am trying to add data to a database using a button, but at the moment of entering the data I get an error in the Prepared Statement part and my SQL statement I tried it on my local server (phpmyadmin) and it worked perfection, and I have not...
asked by 22.10.2017 / 06:40
1
answer

ERR_UNKNOWN_URL_SCHEME Chrome webview client android html file href="tel:"

I need the necessary code to write to my MainActivity.java, to avoid the error ERR_UNKNOWN_URL_SCHEME , I am creating an android application with Chrome webview client that loads an .html file that contains buttons href="tel:" mailto: etc...
asked by 02.11.2017 / 16:50
1
answer

Save pdf file in database

I would need you to guide me, I am setting up a project and I have a window where I should select a pdf file and save it in the database (postgresql). The file should convert it into an array chain and save it, then perform the opposite step to...
asked by 25.10.2017 / 22:01
1
answer

Fill a char array with a string without posting spaces

My goal is to create a program that counts hits by entering this keyboard, the problem is that I can not account for those that are beyond the first space, here I leave what I wrote: public class CuentaCaracteres { static void toma(String...
asked by 16.11.2017 / 06:03
1
answer

Comparator and Comparable Interfaces. Java

My question is: Is it strictly necessary that when using Comparable we implement the interface on the class itself in which we want to establish the comparison and sort criteria for when we invoke sort () using compareTo ()? Or could I create...
asked by 02.02.2018 / 17:08
2
answers

Connect java with mysql

I have a simple java application, which has 2 options, show the amount of paint cans in the inventory, and show the sum of the prices of all the paint cans, and I have all that data in a simple base of data in MySQL, my question is how can I con...
asked by 15.02.2018 / 01:33