Click here to Skip to main content
15,879,326 members
Everything / JDBC

JDBC

JDBC

Great Reads

by Bert O Neill
Query Hadoop using Microsoft oriented technologies (C#, SSIS, SQL Server, Excel etc.)
by Bogdan Marian
Ensure your Docker Compose services start in the correct order
by anshulskywalker
Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools
by V.
How to dynamically build a JQPlot graph through the code behind.

Latest Articles

by Bogdan Marian
Ensure your Docker Compose services start in the correct order
by Łukasz Bownik
A fluent JDBC wrapper written in 200 lines of code
by James A. Brannan
In this tutorial, we secure a simple Rest API. We begin with a simple example, progress to using a custom UserDetailsService, and finish by adding method level security.
by Han Bo Sun
In this tutorial, I will introduce the use of Spring JdbcTemplate in a Spring Boot web application. This tutorial will show how to create the necessary configuration for JdbcTemplate. And how it can be used for data insertion and retrieval.

All Articles

Sort by Score

JDBC 

29 Dec 2015 by Bert O Neill
Query Hadoop using Microsoft oriented technologies (C#, SSIS, SQL Server, Excel etc.)
20 Mar 2023 by Bogdan Marian
Ensure your Docker Compose services start in the correct order
10 Aug 2010 by anshulskywalker
Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools
12 Feb 2013 by V.
How to dynamically build a JQPlot graph through the code behind.
27 Oct 2023 by Richard Deeming
Quote: Adding ORDER BY clause gives the similar order and data every time but I do not need that for the requirement. Except you do need that. If you don't specify an explicit order for the results, then the order is undefined. The DBMS is...
3 Dec 2018 by Han Bo Sun
In this tutorial, I will introduce the use of Spring JdbcTemplate in a Spring Boot web application. This tutorial will show how to create the necessary configuration for JdbcTemplate. And how it can be used for data insertion and retrieval.
5 May 2015 by Jitendra_Jain04
IBM WebSphere Application Server V8.5 Liberty profile is a flexible and dynamic server profile of WAS which enables the WAS server to deploy only required custom features instead of deploying a big set of available JEE components.
15 Jul 2011 by OriginalGriff
Talk to your tutors: they will have a better idea of how complex a project you are expected to produce. They may not give you any concrete suggestions, but they may be able to help you focus your mind on your strengths, and what is acceptable as a final year project.
21 Sep 2012 by Mehdi Gholam
If you are using SQL Server try using Bulk Insert...
16 Apr 2013 by TorstenH.
Extend a base class, which provides the stuff that is shared by all 3 parts (EDIT: like the Connection "conn")But why split that? Looks fine to me like it is.
8 Aug 2013 by ridoy
You should find these interesting..How-to-create-master-page-in-javajsp.html[^]http://www.comp.dit.ie/btierney/oracle11gdoc/appdev.111/b28765/mastdetail.htm[^]
12 Aug 2013 by pasztorpisti
It isn't really a typecast, I would call it conversion. BTW, this question is quite old and answered several times. Use google to find simple things like this. I've used jdbc quite long ago but the following googled solutions seems to be...
18 Jan 2015 by mrcellux
FluentJdbc Query API for more convenient native SQL querying
19 Feb 2020 by Łukasz Bownik
A fluent JDBC wrapper written in 200 lines of code
25 Mar 2019 by James A. Brannan
In this tutorial, we secure a simple Rest API. We begin with a simple example, progress to using a custom UserDetailsService, and finish by adding method level security.
19 Dec 2009 by 0x3c0
This isn't a homework site. If you want source code, then use Rentacoder. If you've already got the foundations of the mailing system, then you need to ask specific questions related to any problems you have.
10 Aug 2011 by Marek Piechut
How to do J2EE JDBC based authentication with JPA Entities in Glassfish
13 Oct 2011 by Jörgen Andersson
It defines which character to use as command separator.On some systems the normally used character might be reserved for another purpose and therefore you're allowed to define it yourself.
29 Dec 2011 by Espen Harlinn
Can you connect to the server using http://www.mysql.com/products/workbench/[^]My guess is that you're having problems with a firewall.Best regardsEspen Harlinn
16 Feb 2012 by TorstenH.
java.lang.Nu...
6 Jun 2012 by Ryan Krage
Display Infobright/MySQL Database Statistics in Java
27 May 2012 by Prasad_Kulkarni
Please refer some links:Storing and Retrieving doc/pdf/xls files in SQL Server[^]SQl Server 2005 : Storing pdf,txt doc files in Tables [^]Store and Retrieve pdf/txt/doc/Images in Sql server database[^]CP Articl: SQL Server - BLOB Import and Export[^]Similar discussions:Save and...
29 May 2012 by Sandeep Mewara
Have a look at these:JDBC connection[^]Tutorial: JDBC - Database Connections[^]Connecting to a MySQL Database in Java[^]If needed, look here[^] for more.
13 Aug 2012 by Andrei Straut
To upload an image using Java (or any programming language, for that matter), you basically have two options:- Upload the picture as a blob (what you're trying to do, BUT, you need to turn the picture into a stream -> see example here[^] for instance), or:- Upload the picture to your server,...
14 Aug 2012 by Andrei Straut
I'm posting this as a solution, and not as a comment, because i think it is a larger explanation, and not a comment in itselfThis line: psmnt = con.prepareStatement("insert into INSTRUCTOR(INAME, ISURNAME, IMAGE, ITITLE) "+ "values(DEFAULT)");PreparedStatements don't work that way. You...
15 Aug 2012 by Andrei Straut
About the fileChooser - You don't display it directly, that's bad practice. You need a "Browse" button, and when your user presses that button, the you display the fileChooser in a modal window. Check below (working example, tested on my computer).First, declare and instantiate your file...
30 Jul 2013 by Shubhashish_Mandal
Check this ..http://docs.oracle.com/javase/1.4.2/docs/guide/jdbc/getstart/callablestatement.html[^]
9 Mar 2014 by Davinder Singla
This tip is for solving out of memory issue for large result sets in MyBatis
22 May 2014 by Maciej Los
Not sure what exact problem do you have...Have a look here: ODBC Data Source Administrator[^] The Microsoft® ODBC Data Source Administrator manages database drivers and data sources. This application is located in the Windows Control Panel under Administrative Tools. Beginning in Windows...
18 Dec 2014 by DamithSL
check below similar questions and the answers:How do I get the size of a java.sql.ResultSet?[^]How to get row count using ResultSet in Java?[^]
18 Dec 2014 by PIEBALDconsult
mysql_insert_id()http://dev.mysql.com/doc/refman/5.7/en/mysql-insert-id.html[^]
23 Jan 2016 by Roland 57
theQuery("delete from authors where id = '"+authorIDLabel.getText()+"'");
7 Feb 2016 by Richard MacCutchan
You have an error in your statement for the Values clause: see PHP Insert Data Into MySQL[^] for correct syntax. Also you should not use string concatenation for SQL statements: see bobby-tables.com: A guide to preventing SQL injection[^].
1 Jan 2018 by RDBurmon
yes it does, but it depends on which image library you use in Java, first of all lets learn about this algoritham Proposed an effective chaotic encryption scheme based on confusion and diffusion principles. • Introduced bitwise circular rotation operation to increase plaintext sensitivity. ...
7 Feb 2018 by shwetakakran
import java.io.File; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; public class InsertTextFileToOracle { public static Connection getConnection() throws Exception { String driver =...
2 Jun 2018 by OriginalGriff
The obvious answer is: the userid and password do not match, so nothing is returned. Use the debugger, to single step through your code and check exactly what is happening, and what is in the various variables. But please, don't do that: Never store passwords in clear text - it is a major...
9 Apr 2020 by Wendelius
One reason for not returning any data could be if the column is case sensitive. You can try the following SELECT pxp.invoice, p2.bookingRef FROM pxp, PolarCruiseBrandPaxFile2 p2 WHERE pxp.invoice COLLATE UTF8_GENERAL_CI LIKE '%' +...
21 Oct 2022 by Richard MacCutchan
Sorry, this site does not provide code to order. If you are unable even to start your assignment then you should review your course notes and/or talk to your teacher.
17 Nov 2022 by Richard Deeming
Quote: insertQueryGetId("SELECT workoutID FROM workout") ... workoutID = statement.executeUpdate(query, Statement.RETURN_GENERATED_KEYS); You're passing a SELECT query to the executeUpdate method. The error clearly tells you that this is not...
22 Jan 2010 by jazy_smith
Hi all, I have the store procedure as described below with four input fields and few output fields. I want to call this procedure from the method : dueDate(Request reqObj) { ... } I want to log the data that is there in reqObj. the input filed described in stored procedure are defined in the...
24 May 2010 by komissar2007
hi i work with jdbc on javaand i use mysql,my question is: how can i create backup of my database?
24 May 2010 by PSK_
This might help.http://www.codeweblog.com/backup-and-restore-mysql-database-using-java/[^]
29 Jan 2011 by vishal deb
HiI am just trying to do somthing in Java. I wrote a small programm in Java using JDBC connecting with MySql. I am using Netbeans 6.9Here is my database structure -Field Type Null Default Descriptionpnr_no int(7) No PNR No.t_no int(4) Yes NULL ...
23 Sep 2016 by Robert Crystler
Hi Friends,I am trying to connect to my sqlserver database using JDBC code. I have some problem with the syntax. I have SQLServer database in my local system. I wrote the syntax,connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://lm1189//:What_I_Pay");// lm1189 is...
16 Mar 2011 by Richard MacCutchan
Some useful information here[^].
31 May 2011 by Ruard
You do not provide much information, so it's just guessing what the problem could be. I noticed that the second parameter is called 'no'. If 'no' is numeric your statement should look like this:stmt.executeUpdate("insert into smstable values('"+message+"',"+no+")");Another possibility is...
10 Jun 2011 by hyperplus
I have a web application which only exposes web services. The web services are just a simple bridge for making stored procedure calls to the database.Currently I plan using Spring JDBC, but how do I inject the DataSource if I have no main function where instantiate it?My guess is the...
11 Jun 2011 by stark9000
https://sites....
16 Jun 2011 by sam_ckp
You can use Spring AOP module, you can inject your piece of code any where in the program.like :a) After b) before c) aroundinside your code as per your requirement check this...
15 Jul 2011 by Nagy Vilmos
Split the table.Each ticket is for one and only one passenger. A booking can be for one or more tickets.BookingField Type Null Default Descriptionbooking_no int(7) No Booking No.t_no int(4) Yes NULL Train No.t_name varchar(30) Yes...
16 Jul 2011 by thatraja
Here you go, look at those answers(Some answers contains links to external sites).Project topic for mca[^]
16 Jul 2011 by RaviRanjanKr
Go there-[Project List based on Java][^] for getting 41 topics which will might help you.
3 Aug 2011 by DeepthiTanguturi
I am changing the value of max_allowed_packet value in my-medium.ini.But it cant updated.How can I solve this problem.
7 Aug 2011 by Kim Togo
My guess is that you are using MySql, correct?my-medium.ini is ONLY a template on how to build up a active configuration.The active configuration is typical my.ini.And and change the value in my.ini file and restart the MySql to activate changes.
20 Apr 2019 by dhruv1707
Hello i have big data in my oracle 10g database and have to perform some calculations on every row of resultset. So i call a separate calculation class after fetching value of single row in the while(rs.next) loop. But this actually gives me multiple java.sql.SQLException: Closed Connection...
26 Sep 2011 by Marc A. Brown
You're closing the connection in pipe_calculations.pipe_parameters_costing(). Given that you're sharing a single connection between all classes (the connection in ConnectionManager is declared static), you're closing it for all objects.
12 Dec 2011 by boude
Hi,I'm trying to get a connection via netbeans to a database server of mine. Problem is that when i try to make a connection, it just loads and never returns with an error or response. I've even tried creating a connection by using the services tab in netbeans. Can anyone help me with this...
29 Dec 2011 by Willtwinny
Okay I currently have a database on my local machine (localhost) and it connects fine using the current code. I can access my database fine, and load data from it.I transferred this database onto a server online.I change the code from:static final String URL =...
8 Feb 2012 by kirrri
connection to the database sql2005
8 Feb 2012 by RDBurmon
Gr8 site for youhttp://www.connectionstrings.com/[^]Hope this helps if yes the accept and vote the answer otherwise revert back with your queries--Rahul D.
8 Feb 2012 by riteshsingh_jsr
This is the command to connect Sql Server 2005:Data Source=.;Initial Catalog=master;Integrated Security=true
17 Feb 2012 by mamba1988
OK, my problem is in line String idmarca = request.getParameter("rid"); it gets the text from the html textfield. Before adding this textfield I was able to save the file paths of the uploaded files
8 Mar 2012 by TorstenH.
I can see identical code parts in there. Also - isn't there a more elegant way to do this? Looks a bit "fixed".The code is not responsible for the 500 record limit. Must be ether your database or you might have a false record on pos. 501.
27 May 2012 by ursatish
Hi All,I am stuck in a situation wherein i am given to design a form(financial year) which contains many unique fields.I want to know how do i insert these many fields to database as using prepared statement would mean my Insert statement would go endless(as the fields are 60).The form pattern...
27 May 2012 by Rajesh Kariyavula
You can create a Data Transfer Object, which will be a class with all your fields as properties. You can create a List of your Data Transfer Object fill it with your form data and send it.You better use to a stored procedure to Insert your Data, if the Data Volume is big. In the case of...
27 May 2012 by Harish PR
I am trying to do a mini Project.in my project i had to store the PDF,document,images in database and that i had display on a jsp page, and those file must able to download.can anyone say me how to store those files in Microsoft sql server. and how to connect the MIcrosoft SQL server...
27 May 2012 by Abhinav S
You can do this by using a binary field.Here[^] is a link that could help you.This link[^] provides another tutorial as well.A similar question[^] was asked some time ago.
27 May 2012 by Prosan
how to save pdf ,images ,doc files in sql server.i think this articale will help you
29 May 2012 by Smart003
plz suggest a link which will give a jdbc connection?
12 Jun 2012 by ursatish
Dear All,I have a table(financial year table).I want my database table to be static.Whatever changes i make in frontend, the same should update in appropriate field in backend.eg.I have 10 rows. i enter details in 4th row.(in jsp page).next when make changes in the dat entered and agin...
13 Aug 2012 by FoxRoot
Hello everyone,I have a table "COURSES" in my JDBC database. I am adding some information via button.I created another button to view what "COURSES" include ? Could anybody show me some way ?I have created a form and put a table and a button inside it.
14 Aug 2012 by FoxRoot
Hello everyone,I am completing my project. That is last corner. But During the day(8 hours) I couldnt step a step. Please help me. I will explain clearly.I want to add instructors into my database which is an jdbc. I created database it is working there is no problem with...
8 Oct 2012 by Thomas Daniels
Hi,Have a look here:http://digiassn.blogspot.be/2006/07/java-creating-jdbc-connection-to.html[^]
23 Oct 2012 by Bhaskar Pathak
import java.util.*;import java.io.*;import java.sql.*;public class Stud{ public static void main(String args[]) { try { Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver Registered"); Connection connection =...
23 Oct 2012 by Nagy Vilmos
The important bid of config is in listener.ora, where you need to set the SID; note that this is not necessarily the service name.There should be something like:SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=foo.bar.com) (ORACLE_HOME=/oracle10g) ...
11 Nov 2012 by jhakas42
i am trying to Exceute this code:import java.sql.DatabaseMetaData;import java.sql.Connection;import java.sql.DriverManager; import java.sql.SQLException;public class ConnectionDemo{ public static void main(String args[])throws ClassNotFoundException,...
10 Dec 2012 by mnd017
Hi, I need a little help with JSF2 application which is run on Glassfish 3 and user authentication . I want to use Form-Based Authentication with Container-managed security. I've got few tutorials but everyone is based on direct connect to database to verify user and password. (like this...
13 Dec 2012 by mnd017
Hi,First of all, I don't have much JSF and JAVA experience. I'm a .NET developer. What I need to do: I need to create a project, which use many (about 20 or 30) databases, but only one at the time. So user will choose which database - on first (login) page. Every database is large (about...
21 Dec 2012 by alexpandy1
I connected a MS Access database with java code and now I want only specific values in database must be set, else it must throw an error with the details of that field
21 Dec 2012 by Mostafa Elsadany
hi everyone how i can use JDBC with android to connect to MS Sql server thanks for any help
22 Dec 2012 by TorstenH.
That's easy:http://appinventor.blogspot.de/2011/07/android-mysql.html[^]Pretty much a common MySQL-Connection. Please search for some MySQL Tutorials when you get stuck there - that stuff is well documented throughout the web.
22 Dec 2012 by TorstenH.
Check out the Case-Statements for the SQL. I guess that's what you need pretty much.http://www.tizag.com/sqlTutorial/sqlcase.php[^]have fun.
30 Dec 2012 by Devendra07
sir i want to add selected jcombo box value into ms access in perticular column??help me plzzzzzzzzi show in code error part??the other value is added in to the database but when i selected any value from combobox and try to saved it will not get saved or shown value of selected value in...
5 Jan 2013 by Chiranthaka Sampath
When I am trying to insert data into a mysql database table I got the following error "Syntax error in your mysql statement near Values(". I don't know how to fix this matter. The source code is stated at the below. If you could please solve my problem!Thank You. private void...
5 Jan 2013 by AmitGajjar
Hi,Incorrect spell Quote:VALAUESit should be values.best luck
5 Jan 2013 by Chiranthaka Sampath
The Correct MySQL statement is at below.sql = "INSERT INTO ITEMDETAILS(" + "ItemCode," + "ItemType," + "ItemSize," + "ItemName," + "ItemColour," + "InStock," +"ItemPrice)" + "VALUES(" + txtICode.getText() + ",'" + txtIType.getText() + "','" + txtISize.getText() + "','" +...
24 Mar 2013 by Royal ɐuɐɹ
This thing is really bothering me. How can I get my dropdown list from MySQL database and then submit it to another table in DataBase. I only know how to create a static dropdown with html and but how can I make it dynamic.i have a table STATE in Database and Now i want to populate all the...
24 Mar 2013 by Prasad Khandekar
Hello Royal,Following JSP code snippet will help you in creating a dynamic dropdown list.SELECT * FROM state ...
16 Apr 2013 by Valentine1993
Is it possible to separate the code into 3 part. I mean 3 different file. First part for connecting to SQL server, second part for manipulating database and third part is for closing the connection. The code is just an example./** * CloseConnection.java * Copyright (c) 2007 by Dr. Herong...
16 May 2013 by gryffin31
Hi,In my project I have two dropdowns in my jsp origin and destination .The first dropdown origin gets populated from databse and second one is dependent on first.Please provide the code without ajax using only jdbc and jsp . The data from database is in a resultset .The following code...
23 May 2013 by Member 10040240
Develop a form based front end for a video rental system and inventorying database using a combination of JDBC commands, SQL, and Swing GUI components to allow users to query, insert, update and delete records using a simple graphical user interface. The basic system is composed of three linked...
23 May 2013 by Richard MacCutchan
You can start with the JDBC[^] and Swing[^] tutorials.
23 May 2013 by CPallini
Actually it isn't very difficult. It is a pretty 'typical' applicvation: Java GUI interating with SQL via JDBC drivers. As precondition you should study Java and SQL (and a bit of JDBC). Afterwards you might find many many examples of similar applications on the web.
18 Jun 2013 by chandan kumar
I imported the project in the netbeans with some external packages but I am not able to solve two problem in package connectionManager.java & log.java. when I Open the file ConnectionManager.java.................................DBPool pool = DBPool.getPool(dbAlias);Error:method...
18 Jun 2013 by Richard MacCutchan
Looks like you got the answer here[^].
30 Jul 2013 by rahul_dhote
i m using java & jdbc & i want to call a method which is calling procedure from database in a main method
8 Aug 2013 by rahul_dhote
I am using JSP, Java, HTML, JDBC, Oracle how to create master form in jsp plz give me suggestions or reference linksrahul dhote
12 Aug 2013 by rahul_dhote
Can someone please tell me that how to typecast string into date as i am using java,jsp,sql,jdbc....
12 Aug 2013 by TorstenH.
You are probably failing at parsing the date.Please make that an extra line and check the format.It's probably best to keep it to the default format:DateFormat df = new SimpleDateFormat();//"MM/dd/yyyy"); // otherCode();String dateValue = ptechdatabean.getFrom_Date();Date...
12 Aug 2013 by Patrick Wanjau
Ensure that the field you're trying to get from contains a date in the format you are formatting. If the date field is null, the NullPointerException is thrown, otherwise it throws the ParseException. In your case, I think your bean is not passing the date, check your code abstraction to see...