How to set a MS Access DB (.mdb) in JasperSoft Studio (Eclipse)? - java

I have a .mdb database and I'm trying to design a report using JasperSoft Studio 6.3.0 (Eclipse plug-in).
In my Java Application I have used the UCanAccess JDBC Driver to build the connection as JDBC-ODBC Bridge is no longer supported in Java 8.
When creating the Data Adapter, I chose "Database JDBC Connection", and then, as UCanAccess is not in the default list of Drivers, I added the .jar file with the UCanAccess Driver.
Screenshot from the Classpath:
Then, I wrote the Driver Class in JDBC Driver (note: the standard action is to choose one of the drivers in the combobox, but as I had to add it manually, I read somewhere in the Internet that I must write it by myself).
Screenshot from the Driver setting:
When I test the connection, it will stay loading forever and will never end.
NOTE: the database has no user/pass. I successfully connected the database to my Java application (using the UCanAccess Driver); my problem is with the connection to the report.
What can I do? Any suggestions? Thanks!

I managed to solve my question by myself. I also had to add the four .jar in UCanAccess-x.x.x-bin>>lib to the Classpath (commons-lang, commons-logging, hsqldb, jackcess)

Related

No suitable driver found for jdbc:db2 with db2jcc4.jar present in web-inf\lib

I am trying to run a simple java web app that connects to a back end DB2 database(IBM dashdb) to get retrieve some data.
I am getting a weird error message when I try to run this application on a ubuntu hosted tomcat 8.5.
I managed to get this application running on a tomcat v8 hosted on Windows.
The actual error message is:
No suitable driver found for jdbc:db2://yp-dashdb......
I don't really understand why this is happening because I have the db2jcc4. in my web-inf\lib folder.
I thought it was something wrong with the library so I created a separate Java app to simply connect and retrieve some data from the database. That one works just fine with the same library.
This is the code used to set up the connection (I trimmed out some of the details).
private Connection conn = null;
conn= DriverManager.getConnection("jdbc:db2://yp-dashdb...");
Keep in mind, that this exact same code works in a Standard Java app so the connection details work and there's no typo in the connection info.
Is there something obvious that I'm overlooking here?
After spending some time trying to figure this one out I find out the problem. My drivers were not being registered by DriverManager. The quick fix I found for this was to manually register it before trying to load the driver.
DriverManager.registerDriver(new com.ibm.db2.jcc.DB2Driver());
This has solved my issue. The way I found out about this was to print out all the registered drivers and print them out. Not the most elegant solution but it helped me find out what I'm missing.
/*
System.out.println("checking for drivers");
Enumeration<Driver> myDrivers = DriverManager.getDrivers();
System.out.println(myDrivers.hasMoreElements());
while(myDrivers.hasMoreElements()){
System.out.println(myDrivers.nextElement().toString());
}
*/
WEB-INF/lib is in your application. It might be so that tomcat needs this driver before your app is loaded? Try putting it into the tomcat's lib folder and restarting...
Here is another question on the same topic: Why must the JDBC driver be put in TOMCAT_HOME/lib folder?

Tibco Connection error while connection Oracle 10g Express Edition

I am trying to connect to Oracle Database 10g Express Edition. While connecting am getting the error as
BW-JDBC-100033 "Configuration Test Failed. Failed to find or load the JDBC driver: tibcosoftwareinc.jdbc.oracle.OracleDriver"
Can anyone please help me on this issue?
Which version of TRA are you using? Be aware that from TRA 5.7.0 onwards, the DataDirect drivers (such as tibcosoftwareinc.jdbc.oracle.OracleDriver) are no longer shipped with the product. If that is your case, you have 2 options:
Download the TIBCO Database Drivers Supplement, which includes the DataDirect drivers.
Download the Oracle JDBC driver, drop the appropriate ojdbc jar in the <TIBCO_HOME>/tpcl/5.x/jdbc folder (create the folder if it doesn't exist) and use the oracle.jdbc.driver.OracleDriver reference in your BW project.

Connection to SQLServer2012 with JTDS driver and Windows authentication

I am trying to connect to Microsoft SQLServer 2012 through Java. I have tried using the Microsoft supplied jdbc driver, as well as the jtds driver.
However, whenever i try to load either of the drivers, I get a "No suitable driver found" exception.
The connection URL i have is:
jdbc:jtds:sqlserver://localhost:1433/mineDB;instance=SQLServer2012;integratedSecurity=true;USENTLMV2=true
The driver class name:
net.sourceforge.jtds.jdbc.Driver
I have loaded the jtds.1.3.1.jar file into my classpath system variable, and when trying to use the windows jdbc driver i did the same
EDIT:
Forgot to mention. the driver is called using Class.forName().
Everything is being done on one machine at the moment, and once it is all working i'm going to see if i can get an external database connection working

MySQL Jar works but MSSQL does not?

I don't use the Class.forName(abcde) for my MySQL-java-jdbc code. My code works properly.
All I did was drop the mysql.jar in my lib folder and the code worked.
But, for MSSQL, this does not work and I get the following error:
java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://localhost:1433
I am using both sqljdbc.jar and sqljdbc4.jar, java 1.6 and MSSQL 2008.
Can you tell me how to find the cause for this problem ?
I think you've got the database connection URL wrong. There should be no microsoft within it. Try jdbc:sqlserver://localhost:1433 instead.
See also the MSDN documentation for the SQL Server JDBC driver.

Error while connecting to Oracle DSN using Java

I need to develop an application that connects to various DSN's using the Microsoft ODBC drivers. I have developed the application in Eclipse and it seems to work properly. The connection succeeds and I am able to view table data.
However when I export the project to a runnable jar file (using Eclipse) the functionality fails for Oracle. It is unable to establish connectivity with the Oracle connection string. It still works for SQL server but fails in case of Oracle. I'm unable to figure out the cause as the same ODBC drivers are being used for both Oracle and SQL-Server. More mystifying is that it runs properly on Eclipse. Since im using the ODBC drivers I don't believe the problem is because of an external jar file.
The driver is sun.jdbc.odbc.JdbcOdbcDriver and connection string is like jdbc:odbc:oratest;user=fell;password=pass.
I'm getting the following exception
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
Can you please help me figure what the problem might be?
Thanks in advance,
Fell
Create a System DSN.
java.sql.Connection cn;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn=java.sql.DriverManager.getConnection("jdbc:odbc:dsn_name","user","pass");
Check the classpath in the eclipse project

Categories

Resources