Questions tagged as 'jdbc'

3
answers

What is the difference between the Statement and the PreparedStatement?

When I paid for the database chair, we only worked with the database, alone with no connection to an application that interacted externally with the DBMS. Only then was Java Database Connectivity (JDBC) introduced. But due to the rush of the cou...
asked by 21.11.2015 / 17:36
1
answer

Use ResultSet without knowing the column type

I need to use a ResultSet that returned the data from a query in the Database. I am making a very generic class, it will be able to be used on any table, so I do not know what kind of data it is returning. For example, the Name column will re...
asked by 17.01.2014 / 17:54
1
answer

Doubts about MySQL integration with Java

I am creating a system in NetBeans, using the Java language and the MySQL database. I wrote the following code to make the connection between the program and the database: public class Conexao { private static final String DRIVER="com.mysql.jd...
asked by 21.12.2016 / 13:56
1
answer

Is it possible to tell the size of the VARCHAR in a NamedParameter?

I'm working on a tuning of a SQL Server database. Through the query below, I can see how the bank ran some of my heaviest queries. SELECT TOP 30 deqt.TEXT AS Query, last_execution_time FROM sys.dm_exec_query_stats deqs C...
asked by 01.11.2017 / 13:14
1
answer

Enter Password to continue

Note: I do not speak Portuguese. This text was translated before it was posted and the translation was reviewed by other users. I'm using Netbeans 8.0.1. For days I've been looking for a solution to this. I've already tried JDialog...
asked by 30.11.2014 / 03:02
1
answer

Call PL / SQL procedure with collection of objects

Consider the following types: CREATE TYPE meu_tipo AS OBJECT ( meu_id NUMBER(6), meu_nome VARCHAR2(200) ); CREATE TYPE meu_tipo_tabela AS TABLE OF meu_tipo; And the following package: create or replace package pkg_test is...
asked by 03.12.2014 / 14:22
2
answers

How do I return the ID of a record right after it is entered?

I'm doing a Java application in conjunction with a MySQL database and would like to know what would be the best command to return an auto increment ID of the database shortly after the registry was entered. My application will work with multi...
asked by 24.05.2015 / 23:20
2
answers

Why is this ResultSet returning null?

If I run a query in the database returns result, however, when I run the code in java, assigning the result to a ResultSet, it appears to be empty. Can you help me? PreparedStatement ps = conectar.con.prepareStatement("select colaborador.codig...
asked by 12.07.2015 / 19:17
1
answer

Spring MVC getJdbcTemplate insert in Oracle return column value

I have a project in Spring MVC, I'm using getJdbcTemplate to do insert's. I just do not enter the primary key in Oracle from a sequence and need that value to re-insert into another table where that value is a foreign key. For examp...
asked by 21.02.2016 / 13:15
1
answer

JDBC - does not connect to Mysql database

In java I created a project where I use the drive mysql-connector-java-5.1.40-bin.jar In this project I created a class with a form to register course and in mysql I created a database called sistema with a table called curso...
asked by 02.11.2016 / 17:49