Most voted "jdbc" questions
Java Database Connectivity or JDBC is a set of classes and interfaces (API) written in Java that send SQL statements to any relational database.
Learn more…213 questions
Sort by count of
-
0
votes1
answer62
viewsHow to prevent me from registering the same movie again
I have this method: test method of the package view location class public int teste(){ String selecao = cbFilmes.getSelectedItem().toString(); String[] campos_filmes = selecao.replace("…
-
0
votes1
answer38
viewsProblems inserting an OBJ into a LIST
I’m doing a survey using the LIKE, in the MySQL with JSF. Whenever I will insert the search result inside a array to return to my JSF, the array add, but always overwrite items with the last…
-
0
votes1
answer166
viewsImproving Login Logic - JDBC - Javaweb
I am developing the method of login of an application, but I’ve been realizing that the query I’m running to check if a user is registered in the system and if his password matches the database data…
-
0
votes0
answers844
viewsWhitelabel Error Page
Hello, I am trying to make a spring boot application with access to mysql database using Jdbctemplate and when I try to access via url the database data always returns me the error: Whitelabel Error…
-
0
votes1
answer97
viewsProblem performing a Java INSERT language
Hello community people, I’m with a problem that I think should be very easy but as I am beginner to me is not rs, I have a Insert to realize that stays in a class called ClienteDAO follows code…
-
0
votes1
answer217
viewsHow to capture more than one attribute from a foreign key?
I’m doing a Java-Desktop Vehicle Rental project. I’m using MVC, DAO and JDBC. In my bank I have the tables Rental and Car: CREATE TABLE IF NOT EXISTS `frota`.`carro` ( `idcarro` INT(11) NOT NULL…
-
0
votes0
answers729
viewsHow to Connect the SQL Server Online Database from the JDBC in Netbeans
I have a question about how to generate the JDBC Java connection URL in the Netbeans IDE to connect to an online SQL Server database. Below is my code, which did not generate a connection like the…
-
0
votes1
answer39
viewsAfter the validation method is true, how to cancel sending the data to the database?
I have the application already made. The class Produto, ProdutoDAO and a method validaProdutoPorDescricao() JButton btnCadastrarProduto = new JButton("Cadastrar");…
-
0
votes1
answer356
viewsError with Mysql insertion with JDBC
I’m running this code: /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the…
-
0
votes2
answers810
viewsSelect Count Java
I want to select with the Count function and bring all the records of a table, but when presenting the quantity in the textfield, it displays a different result. I’ll put the code in for you to…
-
0
votes1
answer878
viewsPassing an Array of Strings to a preparedStatement?
I am trying to pass an array of Strings to a preparedStatement, but it’s returning this exception: java.sql.SQLFeatureNotSupportedException: This operation is not supported. at…
-
0
votes1
answer44
viewsFailed to update field of all records with the file path using JDBC
I am migrating pdf files stored in the database to file systems. In the code as can be seen below, I use an algorithm that generates the name of the files and saves them in a directory generated…
-
0
votes1
answer101
viewsWebservice delete error
I have a problem in my webservice. It is giving this error: Requestfailed Requestfailed --> Status: (405) The code I’m using: @DELETE @Produces("text/plain") @Path("ExcluirLista/{usuario}")…
-
0
votes0
answers547
viewsError in webservice: javax.servlet.Servletexception: java.lang.Nullpointerexception
I am trying to execute a query in my Webservice, but the function that query is inside of, break from nothing. My code: public boolean excluir(String usuario) { String sql = "DELETE * FROM…
-
0
votes1
answer518
viewsError: java.lang.Nullpointerexception in project using JDBC
Could help me with the error below, it is a, I have error in lines 14 of the class Testalista and error in line 32 of the class ContatoDao. Exception in thread "main" java.lang.NullPointerException…
-
0
votes2
answers92
viewsJDBC code fails with exception
I’m trying to perform a database search through java. I am using this code, but this entering the exception: public ArrayList<Pessoas> pesquisar(String nome) { ArrayList<Pessoas> lista =…
-
0
votes0
answers123
viewsTwo filters working in a JAVA report
Staff I’m doing a job for the college I got on the report part and I created the report as the image shows However I could only make the name field work in a second java class I created using the…
-
0
votes1
answer315
viewsTimeout Android Connection and SQL Server using JDBC/JTDS
I would like to limit a time for the connection. Every time she doesn’t find the Host to connect, she keeps trying and it takes. Here’s the code: @SuppressLint("NewApi") public Connection CONN() {…
-
0
votes1
answer566
viewsdoubt with open and close connection
I would like your help with the link below, when I close I have the following error below, am I doing it the right way? regarding the opening and closing of the connection? my pool public class…
-
0
votes1
answer70
viewsError connecting SQL Server to Java in Resteasy API
I’m using the driver JDBC from microsoft 6.0 in a design of an API using Java (JRE 1.8) with resteasy using Eclipse Oxygen and Tomcat 7 (I tried with other versions and presented the same behavior).…
-
0
votes1
answer940
viewsUse a java Resultset to print an entire table on the screen
I know that with the resultset we can do several things with a SELECT done in some table. For example: I know that we can take a table and print its contents, listing which columns we want with…
-
0
votes0
answers28
viewsResultset to return BD data - Java
All right, let’s go... I have a question, I have a Bd with 3 tables and used Inner Join to unite them, and internal function of Postgresql to create a dynamic table, whose result is this: I need to…
-
0
votes1
answer89
viewsJava.lang.Nullpoinerexception when trying to insert database data into a Jcombobox
Today my team and I came across a problem trying to do something seemingly simple: display a clerk’s surname in a Jcombobox. The problem is that when opening the screen we receive a…
-
0
votes0
answers179
viewsFailure to build project in netbeans
when executed works normally but when I call clean and build it shows this error: warning: Supported source version 'RELEASE_6' from annotation processor…
-
0
votes0
answers198
viewsSpring Boot query does not return records
I am developing a system with Java 8 and Spring Boot with JDBC accessing an Oracle base. When I do a query, using Namedparameterjdbctemplate, it does not return any record, but if I copy this same…
-
0
votes1
answer136
views"The Java Exception has ocurred" error while running the Postgre JDBC driver
Follow my problem: 1 - I am using the Postgre 9.6 database. 2 - I downloaded and opened in ECLIPSE a project with example Java application with the use of Hibernate and Postgre that the teacher…
-
0
votes0
answers45
viewsSelect from 2 Java tables
Hello guys I am having problems to bring data from 2 different tables of HSQLDB database my DAO class this so: @Override public List<Animal> listar() throws Exception { List<Animal>…
-
0
votes1
answer382
viewsError : "No Persistence Provider for Entitymanager"
I have a project in Eclipse with an application that persists in the Postgresql 9.6 database through Hibernate, but Java is not recognizing the "persistence-Unit name" which is set in the…
-
0
votes1
answer79
viewsReturn from database values
have two variables: Int id; String Produto; I want to fill the variable "id" with the corresponding value of the "product",. The data is collected directly from the database. public static void…
-
0
votes3
answers1061
viewsWhile Resultset.next() returning only one result
I have a problem when I put the ResultSet.next() in the while and get the information from the column of the Database returns me only one result. Table 'People': Pessoas: Idade: Marcos 22 Marcos 24…
-
0
votes3
answers101
viewsMysql printing multiple times
I’m having a problem printing Mysql data in Eclipse. When I put to print the list of registered data it is printing 3 times each information. I know where the problem is, but I can’t see the…
-
0
votes1
answer130
viewsKeyholder.getKey() can return null - Spring Boot Jdbctemplate
The thing is, I’m a beginner in Spring and I’m doing a method that will insert a new row into a database table and this method will return the Id new that was generated by the Bank, I am doing this…
-
0
votes0
answers78
viewsJava JDBC Mysql syntax error
I have a syntax error here in the mysql query inside the Java code, in the repository. The error is both in the CHANGE method and also in the Delete. package…
-
0
votes1
answer72
viewsResultset object is null after Try-catch. Java
I did a query in my database and it worked, but I’m not able to use the Resultset of this query. I debugged and found that it has a correct content, but it gets null after Try catch where it is…
-
0
votes2
answers92
viewsError doing Insert in BD SQL using JDBC
I need to do an Insert using JDBC Connection, but inserting generates the error below. com.microsoft.sqlserver.jdbc.Sqlserverexception: Conversion failed when Converting date and/or time from…
-
0
votes2
answers370
viewsRun select from the java DAO class
I’m having trouble using a select of a dao class in a main class. You can help me. Follows code. package Model; public class MTotalProduto { private String codigoBarra; private double totalProduto;…
-
0
votes0
answers109
viewsVery slow Java SE application with remote Mysql BD, how to optimize?
Hello, people. I am developing a desktop application with Java SE and testing the software with a remote database it gets very slow, while with the local database it works normally. The following is…
-
0
votes1
answer22
viewsHow to print in a select in a jsp one list within another?
<div align="center"> <table border="1" cellpadding="5"> <caption> <h2>Lista de Usuarios</h2> </caption> <tr> <th>CPF</th>…
-
0
votes0
answers236
viewsError JSP not displayed - HTTP Status 404 - Not Found
jsp code to display error messages: <%@ page isErrorPage="true"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <html> <head> <title>Show Error…
-
0
votes2
answers99
viewsI cannot run a query with jdbc java
public List<Sistema> buscarUsuarioSistemaPor(Long cpf) throws SQLException { List<Sistema> listSistemas = new ArrayList<>(); String sql = "select s.* from sistema as s\r\n" +…
-
0
votes1
answer315
viewsNo suitable driver found for jdbc Sqlstate: 08001 Vendorerror: 0
public static void main(String[] args){ private String DRIVER = "com.mysql.jdbc.Driver"; Connection con= null; try { con =…
-
0
votes1
answer82
viewsissue when connecting mysql to java using jdbc
LoginDAO.java: public class LoginDAO { private static String sql = "select * from login where login=? and senha=?"; private static String url = "jdbc:mysql://localhost:3306/escola"; private static…
-
0
votes0
answers23
viewsWith undoing the delimiter effect on the cut command?
Good morning, everyone. I am using a component in my work, which receives a csv to parameterize data ingestion between sql server and Hive (Hadoop). I can only authenticate to sql server if you…
-
0
votes0
answers114
viewsError Parameter index out of range (1> number of Parameters which is 0)
I’m studying JDBC and learning how the resultset and statement, did first the method of adding and changing data with the statement that worked perfectly private void…
-
0
votes0
answers40
viewsIn my Java web project the mysql driver does not work when using the dependency in the pom.xml file
All right, here’s the deal. I am doing a java web project and when I add mysql-Connector-java as dependency within the pom.xml folder, the project does not communicate with the database. However,…
-
0
votes0
answers24
viewsConnection to bank does not arrive in the Insert method
I’m trying to make an entry into a database mysql using Java. When running the method that creates the database connection, it works. But when making the request by Servlet, when arriving at the…
-
-1
votes2
answers271
viewsUsing data in the database
I am creating a quiz. I managed to create the screen to create the questions, this recording in the database everything right. Only now I will do the "game" itself, so I would have to take a…
-
-1
votes1
answer416
viewsJOIN 3 tables +1 JDBC junction table
I have a program in java that returns the list of users who have an appointment that day, for this I built a database that related some important data of the users, the name of the doctor with whom…
-
-1
votes1
answer1941
viewsInsert with integrity restriction
I have two tables: Table person: CREATE TABLE T_AM_OME_PESSOA ( cd_pessoa NUMBER (8) NOT NULL , nm_pessoa VARCHAR2 (60) NOT NULL ) ; ALTER TABLE T_AM_OME_PESSOA ADD CONSTRAINT PK_AM_PESSOA PRIMARY…
-
-1
votes1
answer455
viewsTo show database query result within a jtextarea
How do I display the data of a query in a database, within a Jtextarea? I did all my list method (which is in the Carrodao class), and I want it to show the data inside the textarea (which is in the…