Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » JDBC(JDBC connection to mysql)
JDBC [message #1792111] Wed, 11 July 2018 16:28 Go to next message
Srikant Nair is currently offline Srikant NairFriend
Messages: 1
Registered: July 2018
Junior Member
Hi This is my JDBC program

import java.sql.*;
public class jdbcconnection {

* @param args
public static void main(String[] args) {
Connection con=null;
Statement st=null;
String sql="insert into employee values(105,'rahul',104)";
int x=st.executeUpdate(sql);
System.out.println("record inserted");
System.out.println("record not inserted");
}catch(Exception e){
}catch(Exception e){

But when i run this

error message
java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(
at com.mysql.cj.jdbc.ConnectionImpl.<init>(
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at jdbcconnection.main(
Caused by: com.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.cj.exceptions.ExceptionFactory.createException(
at com.mysql.cj.exceptions.ExceptionFactory.createException(
at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(
at com.mysql.cj.protocol.a.NativeProtocol.connect(
at com.mysql.cj.NativeSession.connect(
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(
... 6 more

Re: JDBC [message #1792115 is a reply to message #1792111] Wed, 11 July 2018 19:32 Go to previous message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 141
Registered: March 2018
Senior Member
I suggest that you start with something much simpler, get it to work, and then gradually introduce the picky kinds of things that your connection seems to require for whatever your programming purposes are.
Here is what I used when I was trying to make sure what was holding back a connection to a sqlite database. Maybe you can do something similar to start with:

import java.sql.*;
import javax.swing.*;
import java.sql.Connection;

public class sqliteConnection {
	public static Connection dbConnector(){
		Connection conn = null;
		JOptionPane.showMessageDialog (null, "Ready for the try block after declaring conn.");
		try {
			JOptionPane.showMessageDialog (null, "Just inside the try-catch block.");
			JOptionPane.showMessageDialog (null, "Did the Class.forName stuff. Ready for conn- ...");
			conn = DriverManager.getConnection("jdbc:sqlite:/Users/JohnPaulJones/EmployeeData.sqlite"); //Can't be Connection conn
			JOptionPane.showMessageDialog(null,  "Connection Successful.");
			return conn;
		}catch (Exception e)
			JOptionPane.showMessageDialog(null,"sqliteconnection fails with exception:  " + e);
			return null;

I'm on a Mac, so the path is easier to write. For Windows I think you have to use backslashes and you have to escape them so they will function as real backslashes, i.e., instead of Mac's / you have to write \\ to get the path to work right.

Also, I would google for "CLIENT_PLUGIN_AUTH" to find out what this is and where your program should be able to find it.

[Updated on: Wed, 11 July 2018 19:37]

Report message to a moderator

Previous Topic:Workspace continuous refresh
Next Topic:Installation errors
Goto Forum:

Current Time: Tue Jan 31 11:01:30 GMT 2023

Powered by FUDForum. Page generated in 0.12307 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top