Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

how to connect sqlite3 with cipher type : WxSQLite3 ,Cipher : system.data.rc4 encrypted database using java or else remove.

user-ngcgpAug 25 2023

I have tried this method but it creating new database in existing path folder and in result it printing there no such table:mytable.

import java.sql.*;

public class Database1 {

public static void main(String[] args) throws SQLException {

// Create a connection string

String connectionString = "jdbc:sqlite:mydatabase.db;cipher=WxSQLite3;cipher _type=System.Data.RC4;key=mypassword";

// Create a connection object

Connection connection = DriverManager.getConnection(connectionString);

// Create a statement object

Statement statement = connection.createStatement();

// Execute a query

ResultSet resultSet = statement.executeQuery("SELECT * FROM mytable");

while (resultSet.next()) {

// Get the data from the result set

String name = resultSet.getString("name");

System.out.println(name);

}

// Close the connection

connection.close();

}

}

Comments
Post Details
Added on Aug 25 2023
0 comments
127 views