Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to read the properties from the .msi file using java programmatically.

Used
CryptCodecOpener


.jar files:
ucanaccess-4.0.4.jar
hsqldb-2.3.1.jar
jackcess-2.1.11.jar
commons-lang-2.6.jar
commons-logging-1.1.3.jar



What i get :

Exception in thread "main" net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.4 null
	at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:231)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:208)
	at msipro.Msipro.main(Msipro.java:22)
Caused by: java.lang.IndexOutOfBoundsException
	at java.nio.Buffer.checkIndex(Buffer.java:540)
	at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:139)
	at com.healthmarketscience.jackcess.impl.UsageMap.read(UsageMap.java:134)
	at com.healthmarketscience.jackcess.impl.PageChannel.initialize(PageChannel.java:117)
	at com.healthmarketscience.jackcess.impl.DatabaseImpl.<init>(DatabaseImpl.java:554)
	at com.healthmarketscience.jackcess.impl.DatabaseImpl.open(DatabaseImpl.java:415)
	at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:267)
	at msipro.CryptCodecOpener.open(CryptCodecOpener.java:22)
	at net.ucanaccess.jdbc.DBReference.<init>(DBReference.java:171)
	at net.ucanaccess.jdbc.DBReferenceSingleton.loadReference(DBReferenceSingleton.java:51)
	at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:91)
	... 3 more


What I have tried:

try {

String url="jdbc:ucanaccess://D:/msifile.msi;jackcessOpener=msipro.CryptCodecOpener";
Connection connection= DriverManager.getConnection(url,"","");

Statement s = connection.createStatement();
ResultSet rs = s.executeQuery("SELECT * FROM File");
while (rs.next()) {
System.out.println("ss"+rs.getString(1));
}
connection.close();
boolean status = connection.isClosed();
System.out.println("Conn closed = "+status);

} catch (Exception e)
{
System.out.println(""+e);
}
Posted
Updated 8-Jan-23 3:08am
v2
Comments
Dave Kreskowiak 8-Jan-23 12:53pm    
Using an Access database driver to read an MSI will not work.

You would be much better off using the Windows Installer COM interface. How you do that, I have no idea.
Abishek Samuel 8-Jan-23 23:43pm    
Any other Ideas to read a msi database in java
Dave Kreskowiak 9-Jan-23 0:03am    
Yes, an MSI is a database. No, it does not conform to any of the database drivers you're going to find.

The COM library is THE best way to get at the data within.
Abishek Samuel 9-Jan-23 0:23am    
okay thanks .I will try....

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