Click here to Skip to main content
15,615,466 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a beginner, learning Java and now I don't know how to solve this problem in my JDBC program.

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

public class sqliteConnection {
     Connection conn = null;
     public static Connection dbConnector()
    		 Connection conn = DriverManager.getConnection("jdbc:sqlite:C:\\Users\\danil\\Desktop\\Student.sqlite");
    		 JOptionPane.showMessageDialog(null, "Successfully connected to Database");
    		 return conn;
    	 catch(Exception e)
    		 JOptionPane.showMessageDialog(null, e);
    		 return null;

import java.awt.EventQueue;

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

public class Login {

	private JFrame frame;

	 * Launch the application.
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Login window = new Login();
				} catch (Exception e) {

	Connection connection = null;
	 * Create the application.
	public Login() {
		connection = sqliteConnection.dbConnector();

	 * Initialize the contents of the frame.
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);


Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Module sqlite.jdbc contains package, module org.xerial.sqlitejdbc exports package to sqlite.jdbc

What I have tried:

I tried everything, tried solving by myself(but I can't realy I am beginner) ,asked questions on groups (every group deleted post :( )
Updated 12-Aug-22 1:43am

1 solution

Take a look at SQlite Java - How To Use JDBC To Interact with SQLite[^]. And I suggest you create a simple console application to get the SQLite code working first.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900