Squirrel: UnityJDBC throwing ClassNotFoundException - squirrel-sql

I've using Squirrel SQL 3.6.
I have working connections to two databases, which I'll call A and B. I can run queries against A and B without issues. They've been setup and working for a couple years.
I'm needing to run queries against both of these datasources/connections and have Squirrel handle the joins between them.
I've got the UnityJDBC driver added. I've created a connection using same. The next step is to add A and B to it, such that I can run queries across them.
I open the connection, right-click and select "(Virtualization) Add Source" and select A from the list, then tell it to "Add." I don't add any other properties.
It tells me:
Preparing to add data source...
ClassNotFoundException for Driver: com.ibm.as400.access.AS400JDBCDriver
Make sure driver is in your classpath.
If that driver wasn't in the classpath, I'm assuming I wouldn't be able to use connection A at all. Which leads me to believe UnityJDBC has another classpath all its own. Any suggestions on what that would be, where to find it, how to fix this, etc?

As said in this instruction http://www.unityjdbc.com/squirrel/MultiSourceVirtualizationPlugin_install.pdf :
Make sure to add other database JDBC jars into the squirrel/lib folder
or JRE classpath. The plugin cannot access drivers in custom
classpaths used by SQuirreL.
Hope it's not too late and helps ;)

Related

connecting spagobi to cosmos

I'm trying to connect SpagoBI to Cosmos via Hive JDBC driver.
The connection works but I need to add jar (json-serde-1.3.1-SNAPSHOT-jar-with-dependencies.jar) to be able to execute map reduce when querying.
The problem is that spago bi doesn't support multiple queries for the definition of a dataset and therefore I cannot add the jar before executing the actual select (the semicolon is interpreted as part of the path of the jar)
How can I do?
Is there a way to definitely add the jar so I don't have to add it again every time I query hive?
Is this the recommended way to access cosmos data from spagobi or is there a different one i'm not aware of?
Thanks!
You can try this approach: configuring the ADD JAR statement within the connection to the datasource. Have a look at
https://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
Look at connectionInitSqls: you can put the ADD JAR statement there.
Of course this means that you have to configure the connection as a JNDI resource (that is the recommended configuration indeed).
Hope this helps

Datasnap / dbExpress deployment issues

I'm playing around with setting up a Datasnap server on IIS at the moment.
I have managed to get the default Datasnap / Javascript demo to work, and have extended it to include my own string based results to a version of the webpage.
However I am being stumped moving to the next level.
I want to add in a database module and return results from a MySQL database accessed via dbExpress.
As soon as I add a datamodule with a TSQLConnection and TSQLQuery on it and roll out the compiled dll the server stops working. Remove the Datamodule and recompile and everything is fine.
I've tried adding the libmysql.dll and dbxmysql.dll to the website root and adding them to the ISAPI restriction list to allow them to run, but I'm obviously missing something else.
Update
Following some more testing the core issue is with adding an extra datamodule for the TSQLConnection & TSQLQuery. If I include these on the TServerMethods1 unit then the app works...
Dan, insert MidasLib in your USES clause, better than deploying another dll, this will keep everything you need in your executable.

can't create jpa tables in eclipse

I had a working project in eclipse which created a JPA table from entity to mysql database (still learning). Unfortunately it made the table in the wrong database as I wanted there to be 'test' and 'production' databases. Somehow it got the details for the 'production' db, even that it looked like the selected database connection was for the test.
I tampered with the project a bit and made it to connect with right connection object for certain (test). I can ping the db in eclipse (both dbs) and see the db in the Data Source Explorer.
But now I can not create the table(s) for the project by right clicking on it and selecting 'JPA 'Tools' > 'Generate Tables from Entities'.
The creation starts and finishes with no errors, like everything works, yet I see no tables in either of the databases. (In eclipse Database explorer or from command line).
The persistence.xml should be fine as it already created that one table before.
The only error is for the Entity class as it says for the Entity annotation "Table xxx cannot be resolved". And as I see, it's coming from the table not being created.
Here's the persistence.xml just in case.
http://pastebin.com/djPZei90
The project is also a Maven project and it uses SVN. The dependencies were successfully loaded by the maven for the eclipse/project and there is no complications with the SVN.
Because of Maven there are 2 persistence.xml files (only the login credentials and the database name changes), for production and test. It could be that the db-connection was checked and loaded from the wrong file at the 1st place. (just guessing)
Also I tried to create the script.sql when generating the table(s). I found the file but it was completely empty.
Anyway the problem is now that I can't create the tables anywhere.
I am totally puzzled by this. Any hints where I should look to fix this?
Chris had it right, even that I didn't understand the answer correctly at the first reading.
I tried with the other provider, but I may had modified the wrong file by accident (2 'persistence.xml' files as it's a maven project), or there may have been some other reason I failed to spot.
I was given a hint earlier, that I should use the given provider (in persitence.xml). Causing that I didn't pay too much attention to it after all. Since using eclipselink, the provider has to be indeed:
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
Thanks again Chris, even that I failed at the first attempt and had to spend several more hours on resolving this.
Could you solve the problem? Unfortunately I have stumbled on the same rare issue, which totally makes no sense. The JPA Tools just doesn't add the mapping classes for whatever reason, although it writes them into the persistence.xml.
Previous week everything worked flawlessly but now everything is f**. I even created a new independent project in different workspace but it happens the same bug. Obviously it's an eclipse/plugin bug, otherwise I can't explain it. Working with eclipse 4.2.0. I am not happy.
Edit: After removing Dali Tools, JPA Configurator, Seam 3 Plugin creating entities seems to work again. Don't know why, most likely a conflict, but it still doesn't explain why it happened now and not 1 month ago. I didn't change my eclipse install at all since then...
Spend the whole day on this.
I created a completely new (JPA) project in Eclipse (Indigo btw).
Also created a new database (mysql) for that.
Made a connection in Eclipse for that. File > New > Other... > Connection Profile.
Made a new package structure and let the Eclipse create the 'persistence.xml' (src/META-INF/persistence.xml).
I made an 'JPA Entity' class with eclipse wizard. (added 'id' (PK) and 'content' fields)
Copied the 'pom.xml' from my previous project to the new one (made only minor changes like the project name).
Also copied the 'persistence.xml' file from the previous project (src/main/java/META-INF/, no 'test' included). Changed database details and login credentials from the persistence file.
Made the project 'Maven project' in eclipse (right click on project name > Configure)
As it was now a Maven project the default 'persistence.xml' could be removed as it was in wrong place. (Mavenizing the project removed all the errors from un-existing jars with the pom.xml)
Tried to create the table again for the project (Same error, but wait...).
Right clicked on project > Maven > Disable Maven Nature
Then again made it maven project, right clicked on project > Configure > ...
Tried creating the tables again and it created them. Everything works!
Go figure!
Seems like everything was ok, like I suspected. There seems to be some sort of bug with maven (plugin) + eclipse.
Doing the same tricks on the previous project won't help. I even created the entity class with the wizard (removed the existing). The <class> declaration is added to the 'persistence.xml', but it still wont do the table. (Also tried removing and re-adding the maven nature)
I could be missing something on the process/did it differently or doing it wrong whole together. But considering I get the other project work while other doesn't, using the same tricks, there seems to be a big nasty bug.

serverError:class javax.faces.el.EvaluationException could not execute query

I am getting this error from host server. I am using mysql database,tomcat and hibernate orm tool.
How can I solve this problem? Can you help me please?
I was having this problem too.
You should take a look if there's object that is not initialized, then you shoul see if the tables are specified correctly (this is more common if you develop in Windows and deploy in Linux or vice-versa).
For mote details take a look here:
Manager Bean do not returns when the project is online

Subsonic 3.0.0.3 with MySQL 4template is not working

I am ready and see all the tutorials and videos to configure the subsonic 3.0.0.3 with MySql and fail to genarate the ActiveRecords.cs. I use the MySQL.ttinclude in the folder to generate the class but it is still not working. I rename all the refenreces to SQLServer.ttinclude to MySQL.ttinclude and it still does not work. The error is: Metadata file "MySql.Data" could not by found.
I really need to use the subsonic version 3.0.0.3 with MySql 5.1.
I ran into the same issue. Make sure you actually run the installer for the MySQL connector as that put everything in the GAC. I tried to get it to work by just adding the ref to MySql.Data, and I got the same error as you. Everything worked perfectly once I ran their install.
Yes, all reference is setting. The two dlls Subsonic.core.dll and MySql.Data.dll. I think that's probable a bug int the 4templates for MySql. Many people still have problems whit the version for MySql. In the videos of rob for configurin and setting MySQL generate, it still work perfectly, but the files in the pack 3.0.0.3 are different.
dunno if you got same problem but i had trouble and it was because i had a C# project but was using the VB templates and it never created the files, also i have used mysql connector 6.1 if this helps as i think this is the most compatable version when it comes to stuff like this.
Yes, Iam using MySQL Connector 6.1 whit provider. Now I try to generate my class with the 4Templates to LINQ, but I don't have success. I see this error in VStudio 2008
Warning 1 Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive.
When I try to generate the class with the templates for Active Record, It's works, wonderfull, but I realy need the LINQ templates class generated.