cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC adapter error

Former Member
0 Kudos

Hi Everyone,

I am implementing simple File to JDBC scenario. The sender file adpater is working fine, but the receiver JDBC adapter seems to be causing a bit of problems.

I am using MS Access as the data base. Database XI.mdb is in D:/JDBC/XI.mdb

The parameters in JDBC adapter that i have filled are:

<b>Connection String:</b> <i><b>jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//132.186.85.184/D:/JDBC/XI.mdb;</b></i>

<b>JDBC Adapter:</b> <i><b>sun.jdbc.odbc.JdbcOdbcDriver</b></i>

<b>Persistence:</b> <i><b>local</b></i>

<b>Conflict Resolution:</b> <i><b>redo</b></i>

<b>Interprtation of empty string values:</b> <i><b> "</b></i>

These are the only fields filled up in the receiver JDBC adapter.

Now the error that i am getting in JDBC communication channel is:

<i><b>Error during database connection to the database URL 'jdbc:odbc:Driver={Microsoft Access Driver (.mdb)};DBQ=//132.186.85.184/JDBC/XI.mdb;' using the JDBC driver 'sun.jdbc.odbc.JdbcOdbcDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:odbc:Driver={Microsoft Access Driver (.mdb)};DBQ=//132.186.85.184/JDBC/XI.mdb;': SQLException: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xde8 Thread 0x9b28 DBC 0x5156024 Jet'.'</b></i>

Pls advice.

Regards,

Ashish

Message was edited by:

Ashish Goyal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you test the standalone program on the XI or on your local system?

From the path of your posting, I'd suppose the latter.

This could lead to the source of the error.

I don't know your sharing details, but I assume that you haven't shared your partition "D:" with the share name "D:". Instead, you maybe shared the directory "JDBC" with the share name "JDBC". In this case, the correct link to the MS Access file probably is:

//132.186.85.184/JDBC/XI.mdb instead of //132.186.85.184/<u><b>D:/</b></u>JDBC/XI.mdb

bhavesh_kantilal
Active Contributor
0 Kudos

Ashish,

Did you try what Dennis suggested.?

Share the folder JDBC in your machine and then use the path,

<i><b>//132.186.85.184/JDBC/XI.mdb</b></i>

Regards,

Bhavesh

Former Member
0 Kudos

Yes I did that My folder is in 😧 partition and i have shared the JDBC folder too.

So it is:

//132.186.85.184/D:/JDBC/XI.mdb

Still the same error.

Regards,

Ashish

Message was edited by:

Ashish Goyal

bhavesh_kantilal
Active Contributor
0 Kudos

Ashish,

Exactly. Please do not share the 😧 folder. Just share the JDBC folder and then give the URL like mentioned in our previous posts and see if it works?

Regards

Bhavesh

Former Member
0 Kudos

I did that too, i getting the same error again, i believe it's an issue with the drivers as sudheer suggested.

Ashish

Former Member
0 Kudos

Hi,

To find out if the problem is because of path or not just do a simple file to file scenario by keeping the file in the same location as your DB. If that scenario works fine then we can be sure that the problem is not with the path and permissions.

Regards,

Sudheer.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Try giving the path like this

//132.186.85.184/D/JDBC/XI.mdb

instead of

//132.186.85.184/D:/JDBC/XI.mdb

Regards,

Sundar.

Former Member
0 Kudos

I have tried both of these:

jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//132.186.85.184/D/JDBC/XI.mdb;

jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//132.186.85.184/D:/JDBC/XI.mdb;

still same error

Ashish

former_member187339
Active Contributor
0 Kudos
Former Member
0 Kudos

As per the link you sent me, I should stop using ODBC drivers and install Jet drivers:

<i><b>First thing you should do, is stop using ODBC drivers. If you use the JET OLE DB drivers instead (see Article #2126 for a sample connection string), at the very least you'll get a more meaningful error message. Also make sure to apply the most recent MDAC update (MDAC Download Page) and the most recent JET drivers (see Article #2342).</b></i>

From where do i get these drivers and where should i install them

what would be my connection string and Driver string in JDBC adapter?

Regards,

Ashish

Former Member
0 Kudos

Hi,

refer this link.

Refer this link to solve the above error.

http://support.microsoft.com/kb/295297

Regards,

Sudheer.

Former Member
0 Kudos

Hi sudheer,

I went to registry and added myself with full control, but still i am getting the same error.

Also i am able to access the MS access from satndalone java program, using the following code:

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.Statement;

public class AccessJdbc {

public static void main(String[] args) {

try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D:/JDBC/XI.mdb";

Connection con = DriverManager.getConnection( database ,"","");

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery("select * from xi");

while(rs.next())

System.out.println(rs.getString(1)" - "rs.getString(2));

System.out.println("Success");

}catch(Exception e)

{

System.out.println(e.toString());

}

}

}

Regards,

Ashish

Former Member
0 Kudos

Hi Ashish,

If you are able to access it from java program then the problem is with your configurration i.e, XI is not able to access the DB specified in the CC. Is the server having rights to access your DB ?

Regards,

Sudheer.

Former Member
0 Kudos

What rights are we talking about here??

Ashish

Former Member
0 Kudos

Hi,

I mean the folder in which DB is there should be shared and it should be accessible(all neccessary read, write permissions) by sever.

Regards,

Sudheer.

Former Member
0 Kudos

I have put db in JDBC folder and that folder is in my d drive.

I have shared my JDBC folder.

Regards,

Ashish

Former Member
0 Kudos

Hi,

Try accesing the database with stand alone JAVA program. If it works properly then its some thing in XI. If not then its some problem with system registry.

regards,

P.Venkat

Former Member
0 Kudos

How do i do that Venkataramanan?

Ashish

Former Member
0 Kudos

Try this simple code.

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//132.186.85.184/D:/JDBC/XI.mdb";

Connection con = DriverManager.getConnection( database ,"","");
			
Statement stmt = con.createStatement(); 

ResultSet rs = stmt.executeQuery("some select query");
		
while(rs.next())
       System.out.println(rs.getString(1));

Former Member
0 Kudos

Thanks for your answer Venkat, but where do i write this code?

Ashish

Former Member
0 Kudos

HI,

Write this code in any text editor note pad or word pad.

Complie it with command javac <filename> in dos prompt and then run the code with command java <filename>

Make sure you have same filename and class name.

Thanks,

Tuhin