Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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
341 views