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 Tools > Options > Advanced * in that Advanced tab, Class Path is set with `mariadb-java-client-2.4.0.jar` (I have tried with a path `/opt/mariadb-java-client-2.4.0.jar` and `/home/<my user name>/mariadb-java-client-2.4.0.jar`) Based on web site and youtube tutorials, the next steps are to connect via LibreOffice Base. Using the wizard: * Connect to an …

Member Avatar
Member Avatar
+0 forum 3

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 to remove those null value with subjectid value? I don't understand that well because I am a newbie. SUBJECT TABLE (Values inside subject table already exists) SUBJECTID SUBJECTNAME ----------- ---------------- PT3_ENGLISH ENGLISH PT3_BM BAHASA MELAYU PT3_SC SCIENCE PT3_MATH MATHEMATICS CURRENT SERVICE TABLE IN DB SERVICE TABLE SERVICEID SERVICECATEGORY SERVICETYPE STUDENTID …

Member Avatar
+0 forum 0

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 project 1. UCanAcess-2.0.6-bin.zip 2. commons-lang-2.6.jar 3. commons-logging-1.1.3.jar 4. hsqldb-2.3.2 5. jackcess-2.0.4.jar firstly i was thought maybe because of the library, but it still gave me the ClassNotFoundException: net.ucanaccess.jdbc.UcanaccessDriver below is my coding private Connection con; private Statement st; private ResultSet rs;which public void connect() throws SQLException{ try { Class.forName("net.ucanaccess.jdbc.UcanaccessDriver"); con …

Member Avatar
Member Avatar
+0 forum 6

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 java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at ex01.main(ex01.java:34) SQLException: No suitable driver found for jdbc:odbc:J2EE_Database public class ex01 { public static void main(String[] args) { String url = "jdbc:odbc:J2EE_Database"; Connection …

Member Avatar
Member Avatar
+0 forum 2

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 = getDBConnection(); Statement stmt = con.createStatement(); if (sts == true) { String query = "GRANT INSERT,SELECT,UPDATE,DELETE ON hms.* TO '" + MainFrame.dbUser + "'@'" + ip + "' IDENTIFIED BY '" + MainFrame.dbPassword + "'"; stmt.execute(query); System.out.println(query); JOptionPane.showMessageDialog(null, "Permission granted to '" + ip + "' !"); } else{ String …

Member Avatar
Member Avatar
+0 forum 3

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 FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'COURSEID' is not a column in the target table. …

Member Avatar
Member Avatar
+0 forum 2

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
Member Avatar
+0 forum 6

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
Member Avatar
+0 forum 8

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 + "','" + email + "','" + password + "')"; out.println(sql); int i = st.executeUpdate(sql); if (i > 0) { out.println("Inserted!!"); } Code-2 ====== Class.forName(JDBC_DRIVER); con = DriverManager.getConnection(DB_URL, USER, PASSWORD); PreparedStatement ps; st = con.createStatement(); sql = "insert into users (name,email,password) values (?,?,?)"; ps = con.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); ps.setString(1, name); ps.setString(2, email); …

Member Avatar
Member Avatar
+0 forum 1

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. The problem i am having is controlling flow when I call the add() method which is an abstract method in a super class named Student. I call the add() method from the starter class with the main method when I create a new Student object of type Undergraduate which is …

Member Avatar
Member Avatar
+0 forum 2

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; import java.util.logging.Handler; import matrixpeckham.db.DBManager; public class DatabaseLoggingHandler extends Handler { private static final Logger LOG = Logger.getLogger(DatabaseLoggingHandler.class.getName()); @Override public void publish(LogRecord record) { String message = record.getMessage(); String logger = record.getLoggerName(); Throwable thr = record.getThrown(); String thrMess = ""; String thrStack = ""; if(thr!=null){ thrMess=thr.getMessage(); PrintWriter str = new PrintWriter(new …

Member Avatar
+0 forum 0

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 here? What are possible race conditions, concurrent issues, etc etc? Can there be corruption between connections or something? Is there a better alternative to this design for connection pooling? @WebServlet("/LoginServlet.secure") public class LoginServletextends HttpServlet { private static final long serialVersionUID = 1L; public LoginServlet() { super(); } protected void doGet(HttpServletRequest …

Member Avatar
Member Avatar
+0 forum 1

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: 1. Loads countys 2. chose county 3. Second box pops up but with no values in the combobox nd it then crashs and informs me that County_ID cannot be found and "severe null" Code to fill First Combobox with the Countys (Works fine) public Activities_Area_Search1() { try { initComponents(); JdbcRowSetImpl …

Member Avatar
Member Avatar
+0 forum 2

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 information. I have also downloaded JDBC driver from MariaDB site "mariadb-java-client-1.1.3" and also imported this JAR file in my project library in Eclipse. Im facing hardtime connecting to my database. I have tried some Syntaxes available in Websites but nothing worked. Below is my program which DID NOT connect , …

Member Avatar
Member Avatar
+0 forum 9

**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 javax.swing.event.TableModelEvent; import javax.swing.table.DefaultTableModel; public class TestTable { public static void main(String[] args) { TestTable testTable = new TestTable(); } public TestTable() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { } JFrame frame = new JFrame("Testing"); …

Member Avatar
Member Avatar
+1 forum 18

**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 its self window i want customer id 1 only detail not others detail.. how to do any one having any idea related to these... thanks in advanced for the help ??

Member Avatar
Member Avatar
+0 forum 1

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 this code so please check and tell where might be i'm wrong Statement stmt; ResultSet rs; Class.forName("com.mysql.jdbc.Driver"); String connectionUrl = "jdbc:mysql://localhost/test?user=root&password="; Connection con = DriverManager.getConnection(connectionUrl); stmt= con.createStatement(); rs=stmt.executeQuery("select * from atunesblue"); String pname=rs.getString("projectname"); String pnm = "atunesblue"; while(rs.next()){ if(pnm.equalsIgnoreCase(pname)) { System.out.println("Mubarkaannnnnnnnnnn"); } else { System.out.println("fitay munh"); } } } catch …

Member Avatar
Member Avatar
+0 forum 2

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 to a brand new Jframe with a populated Jtable. Now everything does what its meant to do except the jframe window which opens as the border of the window and the minmise,maximise and close buttons. You can view the database by expanding the jframe window from the bottom right corner(Click …

Member Avatar
Member Avatar
+0 forum 7

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 way but at this stage my brain is fried from lookin at this code and i am not making any head way. The search box Code: import com.sun.rowset.JdbcRowSetImpl; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Joe Lyons */ public class BB_Value_SearchBox extends javax.swing.JFrame { /** * Creates …

Member Avatar
Member Avatar
+0 forum 3

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 above example: 1. ID NAME SALARY STREET 2. 321 TIM 1254 14 avenue 3. 121 PAUL 1265 28h oktovriou 4. 432 NICK 4521 papaflessa I have off course plenty of such files which contains many more rows and columns. The purpose of my program is to read the data, create …

Member Avatar
Member Avatar
+0 forum 3

how to install jdbc driver for mysql java connector

Member Avatar
Member Avatar
+0 forum 2

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
Member Avatar
+0 forum 3

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
Member Avatar
+0 forum 5

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 row as I wanted. My problem is when I do a combination of calling the insert, delete multiple times the row inserted shows up on the position where the last deleted row was** **when I delete the newly inserted row positioned at the deleted row and inserts it again it …

Member Avatar
Member Avatar
+0 forum 1

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 B=value2. How can i do this please help how can i start?

Member Avatar
Member Avatar
+0 forum 4

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] I'm wondering if it's not possible to have two "statements" ending with ";"in one PreparedStatement. When i run the sql in phpMyAdmin it works but from the server i get an exception: [ICODE]com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server …

Member Avatar
Member Avatar
+0 forum 5

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 change the database values, save, close mySQL and re-execute the code it still displays the first set of values. I reloaded mySQL to make sure it wasn't a problem with the database, but sure enough it shows the newly entered values. Could someone please take a look at my code …

Member Avatar
Member Avatar
+0 forum 14

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 = connection.prepareStatement(sql); ps.setString(1, customer.getName()); ps.setString(2, customer.getAddress()); ps.setString(3, customer.getPhone()); int n = ps.executeUpdate(); ps.close(); return n > 0; //Manage Customer servlet } public String deleteCustomer(String id) throws Exception { String sql = "DELETE FROM Customer WHERE customer_id = ?"; PreparedStatement ps = connection.prepareStatement(sql); ps.setString(1,id); System.out.println(ps.toString()); ResultSet rs = ps.executeQuery(); int n …

Member Avatar
+0 forum 0

I am using two ResultSet in a single statement..this code is a part of servlet.. [CODE] String temp=request.getParameter("cid"); int cid= Integer.parseInt(temp); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:Mydatasource"); PreparedStatement ps = con.prepareStatement("select * from Products where cid=?"); ps.setInt(1, cid); ResultSet rs = ps.executeQuery(); while(rs.next()) { out.println("<a href = 's_BikeServlet?pid="+ rs.getInt(1) + "'>" + "rs.getString(2)" + "</a>"); //rs.getString get the name of the bike which has to be made a hyperlink } [/CODE] but when i run this.it give java.sql.SQLEXCEPTION (No Data found)..but when i use only single ResultSet it Displays correctly..

Member Avatar
Member Avatar
+0 forum 26

I want to count the total no of rows in a table [CODE] Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:gabbar"); Statement ps1 = con.createStatement(); ResultSet count = ps1.executeQuery("SELECT COUNT (*) FROM products ); //products is a table in database [/CODE] count is of ResultSet type.but i want to do arithmetic operation on count variable.i want count to be in int datatype.what should i do? i dont know how to solve this problem

Member Avatar
Member Avatar
+0 forum 4

The End.