61 Topics

Member Avatar for
Member Avatar for dimitrilc

## Introduction ## When working on Java applications, it is very likely that you will run into JDBC at some point. While you are unlikely to have to work directly with JDBC when using frameworks, it is still important to know how the connection is established and how queries are …

Member Avatar for dimitrilc
2
144
Member Avatar for Violet_82

Hi there, I've come across an issue while trying to get all the records from a SQL database in java. A bit of necessary introduction here. I'm not using any framework just JDBC and the getAllBooks method is part of a REST call. The failing method is essentially doing this: …

Member Avatar for Violet_82
1
527
Member Avatar for dwlamb

I am trying to establish a connection between LibreOffice (5.4.6.2) and Mariadb (10.1.29)/mysql. I have researched various resources on the web but am stuck not being able to establish a connection preliminary steps taken: * the file mariadb-java-client-2.4.0.jar is downloaded from [https://downloads.mariadb.com/Connectors/java/connector-java-2.3.0/](https://downloads.mariadb.com/Connectors/java/connector-java-2.3.0/) * JRE is installed and enabled under LibreOffice …

Member Avatar for tejal_1
0
5K
Member Avatar for lucy nana

I facing a problem with checkbox value that already exists inside the database. so how can I retrieve those value into another database table? The table subject and service below is what I want. But based on the code below the SERVICE TABLE on SUBJECTID COLUMN producing null value. How …

0
400
Member Avatar for Vegito1991

I was doing my login access with ms access database (accdb), supposed can work but after i upgrade to java 8, it no longer able to support odbc and i was struggled to solve this problem, and it gave me the ClassNotFoundException list of library i have in my netbean …

Member Avatar for Arun_18
0
6K
Member Avatar for hwoarang69

I am using Eclipse, java8 I am trying to connect access database with eclipse but it is not working. I first created data source in "ODBC Data Source Administrator(32-bits)" for windows and than I added the jar file (mysql-connector-java-5.1.35-bin) But I am getting an error: ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver at …

Member Avatar for hwoarang69
0
908
Member Avatar for 47pirates

I'm trying to give access to client computer from my server and also tryin to revoke the granted access... the grant is successful but the revoking is not working please help. hms is the satabase that i want to give access to my clients.. my code try { Connection con …

Member Avatar for stultuske
0
1K
Member Avatar for TekknoDraykko

Greetings again! I'm learning how to write to and read from databases using JDBC, (using Netbeans) and I've run into a snag. I'm trying to save data to a database, but when I try the following exception message is thrown: Column 'COURSEID' is either not in any table in the …

Member Avatar for TekknoDraykko
0
362
Member Avatar for usiyalla

Can any one send me the config setting for jdbc and mysql using apache server setting in netbean. i wanna use jsp with xampp and jdbc

Member Avatar for hemeneugene
0
809
Member Avatar for Doogledude123

Hey, I'm looking for decent MySQL tutorials for connecting a Database in Java. I'm using Java 8 so preferably would like tutorials that correspond with newest code. Thanks!

Member Avatar for JamesCherrill
0
371
Member Avatar for Shreyas_1

I have two different format of code for insert query using jsp+servlet+mysql. Code-1 ====== Class.forName(JDBC_DRIVER); // Open a connection out.println("Connecting to a selected database..."); con = DriverManager.getConnection(DB_URL, USER, PASSWORD); out.println("Connected database successfully..."); // Execute a query st = con.createStatement(); sql = "insert into users (name,email,password) values ('" + name + …

Member Avatar for stultuske
0
2K
Member Avatar for StephenopolousINC

Hello everyone, I am doing an assignment that requires me to create an application that manages a student records database. They gave me the option to use a GUI or console application so I am making it a console app. The task requires that we use the abstract class pattern. …

Member Avatar for StephenopolousINC
0
272
Member Avatar for sciwizeh

Ok, so I'm working on a web-project, I connected a custom hanlder to the root Logger in `contextInitialized()` of a ServletContextListener: @Override public void contextInitialized(ServletContextEvent sce) { Logger def = Logger.getLogger(""); Handler hand = new DatabaseLoggingHandler(); hand.setLevel(Level.WARNING); def.addHandler(hand); } which looks like: import java.io.PrintWriter; import java.io.StringWriter; import java.util.logging.LogRecord; import java.util.logging.Logger; …

0
248
Member Avatar for Vanquish39

Question regarding concurrency. Imagine 10 different doGet() requests from 10 different users around the world called within milliseconds of each other to a servlet called LoginServlet.java. Inside the servlet's doGet() method is a call to DbUtil.getConnection(). The DBUtil class is static and the method getConnection() is also static. What happens …

Member Avatar for ~s.o.s~
0
266
Member Avatar for joseph.lyons.754

Hey Guys, What i want it to do : 1. Combobox is displayed with a list of countys ie Limerick Dublin Cork 2. Choose County brings up second Combobox with countys towns and villages. 3. Hit search brings up relevant towns and vilages from the county chosen. What it does: …

Member Avatar for joseph.lyons.754
0
287
Member Avatar for murali2489

Hi All, I am new to use of database in Java. I am trying to write a simple java application which connects to my Database and sends some query and retrieves the output. I have downloaded MariaDB and then created a database named iff and created tablespaces which has some …

Member Avatar for murali2489
0
509
Member Avatar for Deve

**I want to enter the value in jtable run time and want to dispaly its sum on same jtable when i pressed calculated button ** how to do please help :) import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.*; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; import …

Member Avatar for Deve
1
2K
Member Avatar for Deve

**Bold Text Here** hey any one can help me sort out my problem.. when i enter the customer id then in tabular format i want its all detail. how to do.. like in textBox i enter customer id as 1 then pressed ok button then in new frame or in …

Member Avatar for peter_budo
0
240
Member Avatar for FaisalSarfraz

Hi all I am new to java programming. I need a litte helop. I want to take some results from database so i am trying to connect to database. I have dowloaded jdbcmysql connector but having no idea how to add it in eclipse or jre. Plus i am having …

Member Avatar for jwenting
0
340
Member Avatar for joseph.lyons.754

I have been tryin to get this to work for the past week if not two >:( with no joy. Worst of all its such a trivial problem. The program asks you to choose a town name from a combo box when you choose the location you shoud be brought …

Member Avatar for JamesCherrill
0
423
Member Avatar for joseph.lyons.754

Hey Guys, I am working on a search that takes in a value via textfield. Once taken in it should display another Jframe with the info but the searchbox crashes the second I run it. Its some stupid mistake I have made or i have gone about it the wrong …

Member Avatar for JamesCherrill
0
375
Member Avatar for ef_mag

Hi, i have plenty of excel files i have to read them and store the data in a database. I am using eclipse as editor and mySQL. I am using APACHE POI to read the excel files and JDBC for the connection. The excel files have the structure as the …

Member Avatar for JamesCherrill
0
2K
Member Avatar for teena carmel
Member Avatar for crownedzero

I'm working on a static method that I want to use to query mysql; I'd like the option of handing a char in but I'm only seeing string or int, what if I want to use a wildcard? '_' or an int '1', anyone have a clever solution?

Member Avatar for Taywin
0
705
Member Avatar for abhishek20

Hi i am using java code to connect to MS access using following url jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/login.mdb Now if I need to connect to the run this java code from some other machine in network then how will I write the path "DBQ=C:/login.mdb"

Member Avatar for Pradeeps206
0
341
Member Avatar for zeroliken

I got the insert and Delete Data/Row working for my DBMS. The deleteRow method finds the row that contains the same primary key from the database, passed on to the method, and deletes the row. With using the insertRow method, the data I added shows on up on the last …

Member Avatar for Taywin
0
262
Member Avatar for 47pirates

I'm trying to make a search by different option say A, B . what i need is if user provide value of A only then it does the searching using parameter A only , if user provide A and B then it needs to do searching using condition A=value1 AND …

Member Avatar for 47pirates
0
302
Member Avatar for velr

Hello! I am working on a server program that has a connection to a MySQL database. In one of my sql:s i need to use [URL="http://dev.mysql.com/doc/refman/5.0/en/user-variables.html"]User-Defined Variables[/URL] but i can't get it to work. The sql looks something like this: [ICODE]"SET @rank=0; SELECT id FROM (SELECT @rank:=@rank+1 AS rank ..."[/ICODE] …

Member Avatar for JamesCherrill
0
2K
Member Avatar for speakon

Hello, I need to create a JDBC that connects to a mySQL database, retrieves the data from a table and displays it into a JTable. I have done this successfully, but have ran into a problem. The initial values I entered into the database (for testing) are permament. If I …

Member Avatar for speakon
0
361
Member Avatar for alanborder

package edu.edusys.demo.jdbc.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import edu.edusys.demo.jdbc.bean.Customer; public class CustomerDAO { private Connection connection; public CustomerDAO(Connection connection) { super(); this.connection = connection; } public boolean addCustomer(Customer customer) throws Exception { String sql = "INSERT INTO Customer" + "(name,address,phone)" + "VALUES (?,?,?)"; PreparedStatement ps …

0
211

The End.