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
-
2
votes0
answers157
viewsJPA + Eclipselink - Lazy Loading with closed Entitymanager
I am using Eclipselink as JPA preview in a Java SE project. I have correctly configured Weaving to allow Lazy Loading. Unlike Hibernate (which launches Lazyinitializationexception), Eclipselink…
-
2
votes1
answer146
viewsReturn Connection as Boolean?
It would be possible to modify the class so that it returns to jFrame the result of the connection as Boolean? public class ConectarDB { private static Connection con = null; public static…
-
2
votes3
answers5297
viewsJDBC connection to Mysql
I’m learning how to develop java and I’m trying to advance my studies to understand how to make a database connection, but there’s some problem that I’m not able to identify. Below the error written…
-
2
votes3
answers818
views -
2
votes1
answer75
views"Error: Can not Issue data Manipulation statements with executeQuery()" no Select
Doing the method to select all data from a table, but is returning me error. console: Open bank. java.sql.SQLException: No value specified for parameter 1 No value specified for parameter 1 at…
-
2
votes2
answers221
viewsError in CRUD UPDATE command - java.sql.Sqlexception: No value specified for Parameter 8
I am building a Java system with connection to Mysql database, but I stopped at a certain point because I can’t locate the error. My update method happens an error in Junit, but I can’t figure out…
-
2
votes0
answers81
viewsLoading Jtable and processor gets high in process
I’m making a sisteminha and in it has a JTable and I need to loader my data, I’ve been analyzing by task manager that when this table load function is called, it greatly increases the processor…
-
2
votes1
answer2870
viewsJDBC - Run a query and use its return as a parameter for another query
I am learning to code in java, alone with the help of tutorials and I am trying to do a procedure where the result of a query will be a clause where for a second consultation. In the example below,…
-
2
votes2
answers393
viewsError storing data from a Select with Java
Good morning guys. I wonder if you have the possibility to store in a variable the value of a search (select). In case I want to store one id another table using a select, however after doing the…
-
2
votes3
answers5148
viewsReturn BD data using List/Arraylist - Java
I have a problem, I set up a dynamic table in Postgresql and I need to print the lines of it, performing a method in Java, whose beginning is already pre-set. That would be with a List simple with…
-
2
votes1
answer305
viewsjava.sql.Sqlexception: Can not Issue data Manipulation statements with executeQuery()
My key insertion is not being done. And the error that occurs in the console is: java.sql.SQLException: Can not issue data manipulation statements with executeQuery(). at…
-
2
votes1
answer291
viewsError deploying with Tomcat 7
I made an app with springboot and when I run it inside the springboot it works normally but when I run War and I put to run in Tomcat it gives some errors. I’ve tried a few things I’ve seen on the…
-
2
votes1
answer55
viewsProblem showing data Many to Many
I’m having trouble displaying the result of the query. I’m not being able to display the results correctly. I have the following tables and records: CREATE DATABASE IF NOT EXISTS `livraria`; USE…
-
2
votes2
answers67
viewsHow to programmatically rescue a newly inserted auto increment ID in JDBC?
I am saving a feature for time-consuming processing and must return your ID so the user can check its status in the future. The idea is that the user insert a set of data for import (for simplicity,…
-
2
votes2
answers1169
viewsException error in thread "AWT-Eventqueue-0" java.lang.Nullpointerexception
I’m doing a college project where I can register, change, delete and consult a product. In the query part, I try to search for the ID. Only this error happens and I am not able to solve. Exception…
-
2
votes1
answer106
viewsProblems with the JDBC connection
Good morning, my dear. I’m having trouble with jdbc. The connection to the bank is made but, does not bring anything with select. The eclipse console reported me some problems, such as: The…
-
1
votes2
answers2022
viewsSimple authentication example with level without Hibernate and spring
I would like a simple example of user authentication. I already have the table in the database, which contains the user data and level (Administrator, common user). As I have no time to mess with…
-
1
votes1
answer1107
viewsJDBC+mysql remote error while connecting
Introducing I am developing a program in java that can change the connection of the database, I have 1 local database (127.0.0.1:3306) and a remote database (192.168.25.75:3306) that would be a…
-
1
votes2
answers167
viewsUse of the database connection class
It seems to be a silly question but come on, I have some tables in my database and I need to query them, but they are not @Entity, I did not create the sources, the only way to do the queries would…
-
1
votes2
answers81
viewsIs it possible to make two Selects in a Try?
try { Connection lig = DriverManager.getConnection("jdbc:mysql://localhost/gym", "root", "0000"); PreparedStatement inst = lig.prepareStatement("SELECT * FROM produtos_has_historico WHERE…
-
1
votes1
answer610
viewsStatement and SQL Run Error - Netbeans
try{ Class.forName(driver); Connection conn = DriverManager.getConnection(str_conn, usuario, senha); Statement stmt = conn.createStatement(); String sqlinsert ="insert into cheque…
-
1
votes1
answer88
viewsIncremental key
Guys, I’m doing a web service with Java + Postgres. I set my table in Postgres as follows: CREATE TABLE usuario ( id serial NOT NULL, nome character varying(40), idade integer, CONSTRAINT…
-
1
votes0
answers176
viewsCommunication failure with Communications link Failure database
I have a database that is in the cloud, because it’s from a site that I and some colleagues are creating and I needed to connect it to Netbeans, I put the host, the name of the database, user and…
-
1
votes1
answer1876
viewsReturning database id in a global variable. How to fix?
After command insert, i can recover the id generated by the database using a global variable public static int returnID. But I didn’t think it was very cool to leave the variable static. Is there…
-
1
votes1
answer72
viewsProblem with database insertion
I have in my system the following code: public int insert_dependente(Dependente dependente) { ResultSet r; int result = 0; if (!(dependente == null)) { try { Connection conn = new…
-
1
votes1
answer319
viewsTaking reserved SQL words out of a Java string
I’m making a view that has an open field (textarea) where the user can write SQL and then run the same SQL. The point is that the oracle user where it will run SQL has permissions for everything and…
-
1
votes2
answers858
viewsHow to check if a table exists using jdbc java
How to check if a table exists in jdbc using Sqlite3?
-
1
votes1
answer554
viewsJDBC connection in Eclipse Neon
I need help adding the JDBC driver to my project done in the Eclipse Neon version. If possible pass a connection class to test.
-
1
votes2
answers689
viewsDate value 0000-00-00 cannot be used in java Date
First of all yes, I’ve already added ?zeroDateTimeBehavior=convertToNullin the connection URL the problem is that in the query the reset date is not null and always release the following…
-
1
votes0
answers35
viewsPopular Tableview with dice coming from apache derby
I’m trying to popular tableview with data from apache derby but I’m not getting it. Follow the code: Telaagenda class: package view; import java.awt.ScrollPane; import java.util.Observable; import…
-
1
votes2
answers167
viewsError with SQL and Mariadb (Current position is before the first Row)
I have a problem in my database and I have no idea what it is. public String getBlockPermission(String blockstring){ String permission = ""; try{ ResultSet res =…
-
1
votes1
answer498
viewsWhat’s the difference between running and executing?
What’s the difference and when to use executeQuery() or executeUpdate()?
-
1
votes1
answer124
viewsInterrupt Thread (Java) does not kill execution in Oracle database
Guys, I’m working on a script runner PL/SQL, using the JDBC Statement to make my connections with the bank. My problem is that the project works with Threads and when the user wants to interrupt the…
-
1
votes0
answers55
viewsProblems connecting with Ive via Dbeaver
I have a problem connecting to Hive by Dbeaver! Could not open client transport with JDBC Uri: jdbc:hive2://b4fa09-edhhdinsightshadoopgbdev-Hdi-dev-Gb.azurehdinsight.net:443/finance_hz:…
-
1
votes1
answer40
viewsProblem to sum values in JDBC
The console presents me the following error: FUNCTION worksoviagemd.SUM does not exist. Check the 'Function Name Parsing and Resolution' Section in the Reference Manual Can only be sql in my…
-
1
votes1
answer587
viewsError: Parameter index out of range (1 > number of Parameters, which is 0)
I am trying to remove a data from the bank, but the following error happens: Parameter index out of range (1 > number of Parameters, which is 0) Can you help me? public void remove(Bean e) { try…
-
1
votes2
answers68
viewsIs it necessary to place the element type inside the Try?
When optimizing my JDBC code I started using a condition within Try. /** Função PreparedStatement stmt */ public PreparedStatement stmt; /** Funçãoo ResultSet rs */ public ResultSet rs; /** Método…
-
1
votes1
answer1682
viewsjava.lang.Runtimeexception: java.lang.Classnotfoundexception: org.postgresql.Driver
I created the DAO, MODEL, CONTROLLER packages and a test It runs normal with the server, persists in the normal bank but through the viewing layer. I wanted to test in main running with java…
-
1
votes0
answers486
viewsApostille Caelum fj21 mysql driver error
Good afternoon, everyone, Starting I am studying the Java WEB workbook from Caelum but the following error is appearing. I already imported the Mysql driver, I switched between the commented line…
-
1
votes0
answers31
viewsActive Jdbc Association not work
Hello. I have two classes: User and Competition. I need to make a relationship between the two, as below: public class User extends Model{ } @Table(value = "competencias") @BelongsTo(foreignKeyName…
-
1
votes0
answers87
viewsConnections in web application
I am creating a J2EE, jsf project. They have multiple Beans and controller, and the Beans access the Database. I’m having doubts how to manage the Connection for the database, right now I only have…
-
1
votes2
answers362
viewsIs it possible to store user inputs by the Scanner Class in a database?
I have an application made in Java, and I need to store the user’s registration information in the database: Cpf, password, name, address, telephone System.out.println("Digite seu CPF"); cpf =…
-
1
votes2
answers716
viewsUsing java change method
How I change the database using the method changes in a Testaaltera class. I use the model gets and sets to change the data? I need to use the Search(int id) method to return an object? //pesquisa…
-
1
votes1
answer209
viewsError Mysql and android connection
I’m developing an app that needs to have an external connection and I’m having a running problem, how could I fix this? Follows the code: import java.sql.DriverManager; import java.sql.SQLException;…
-
1
votes1
answer79
viewsJSP Project with Database
I am working on a JSP project with database my driver is not being recognized. I am using the following method to connect to the bank. public ConnectionDB(){ try {…
-
1
votes1
answer309
viewsConnect to oracle 11 c
I am trying to connect on oracle 11 c and the connection is not performed. Gives error: ES Error: Got Minus one from a read call > I’m testing the query in a Servlet, I’m not searching for the…
-
1
votes2
answers284
viewsScreen to configure Mysql connection
I am currently using the following code to run connections with my DB public class ConexaoDAO { public Connection getConexao() { try { return…
-
1
votes0
answers528
viewsHow to export a postgres table with column names to csv format with jdbc?
This is my code, which unfortunately does not export column names: package net.viralpatel.java; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import…
-
1
votes2
answers1268
viewsSearch in a table in Mysql with Java
I’m having trouble trying to get something on the table, I’m new so I did it the way I know. Button code: livros.setPesquisarLivro(txtLivro.getText()); try { modelo.setNumRows(0); for (ObjetoLivro c…
-
1
votes1
answer190
viewsJava with Mysql (JDBC) - Type YEAR
I have a question on how to record a YEAR type in the MYSQL database using a Java application from a Textfield, I have tried using Date type, but I can’t take only the year to record in the YEAR…