Enabling Oracle jdbc driver logs on Websphere 6.1 - oracle

I am having some problems with an Hibernate Criteria query causing a outOfIndex error at driver level, I am pretty sure the problem is at the driver as I have being debugging and everything seems ok, but to be sure and be able to report the error I need to enable traces and I am not being able to do so.
I have added ojsbc5_g.jar as a new JDBC provider and created a new data source with it, renamed the jndi of the old one so the new debug data source uses the same and tried using -Doracle.jdbc.Trace=true -Djava.util.logging.config.file=ConfigFile.properties
at the server JVM configuration (using a absolute path for the file and a relative one).
The data source and the app works but no log appears, then I found the data source custom properties so I modified the level and the filename and now the file is there but empty.

The JVM Configuration should include:
-Doracle.jdbc.Trace=true -Djava.util.logging.config.file=/jdbc/OracleLog.properties
and the mentioned properties file should include something like:
.level=SEVERE
oracle.jdbc.level=ALL
oracle.jdbc.handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
You can set the logging for following targets depending on the nature of your problem:
oracle.jdbc
oracle.jdbc.driver
oracle.jdbc.pool
oracle.jdbc.rowset
oracle.jdbc.xa
oracle.sql

Related

Unable to connect to SQL Server using the quarkus-hibernate-reactive due to incorrect reactive.url

I had worked on Quarkus connecting to Postgres. But this is the first time I am trying to connect to SQL Server, which is the default server in my current project. I am following this guide to create a database component.
The properties file contains the following:
quarkus.datasource.db-kind=mssql
quarkus.datasource.username=<user-id>
quarkus.datasource.password=<pwd>
quarkus.datasource.reactive.url=sqlserver://localhost:1433/<db-name>?currentSchema=<schema-name>
quarkus.datasource.reactive.max-size=20
hibernate.default_schema=<schema-name>
The application starts fine, but when I make a request to the Resource that internally uses the repository, I get the following error:
Internal Server Error
Error id f0a959d2-3201-4015-bfd7-6628ae9914d1-1, io.vertx.mssqlclient.MSSQLException: {number=208, state=1, severity=16, message='Invalid object name ''.', serverName='<sql-instance>', lineNumber=1, additional=[io.vertx.mssqlclient.MSSQLException: {number=8180, state=1, severity=16, message='Statement(s) could not be prepared.', serverName='<sql-instance>', lineNumber=1}]}
This means, my application is able to connect to the database, but it is not able to find the table. The table exists in a schema, and I am unable to pass the schema which may be the cause of the issue. If you check the properties file, I have tried with two options:
Adding 'currentSchema' as a query param
Adding the property 'hibernate.default_schema'
But none of the two options are working. There is no documentation on SQL Server that can help me provide the right configuration to the Quarkus application. Please help.
The correct property is quarkus.hibernate-orm.database.default-schema It is possible to check all the available configuration properties in this url https://quarkus.io/guides/hibernate-orm#hibernate-configuration-properties

Is it possible to configure Apache Ignite QueryCursor to be autocloseable in the xml configuration file?

I am writing a program in Golang that connects to local Ignite clusters through an ODBC driver package written in Go.
During development I began getting this error repeatedly:
Too many open cursors (either close other open cursors or increase the
limit through
ClientConnectorConfiguration.maxOpenCursorsPerConnection)
[maximum=128, current=128]
After opening an issue with the golang odbc packgage I was using and providing a sample app, the author was kind enough to help me verify there was no issue in the golang code that would result in leaving cursors opened: https://github.com/alexbrainman/odbc/issues
I have since attempted to configure the setting for QueryCursor to value autoclose in the xml file I use for Ignite Configuration on initiating a cluster. I have used this doc as reference: https://ignite.apache.org/releases/latest/javadoc/index.html
However after some attempts I am not sure whether my syntax is wrong, or this is simply not a configurable property through the xml configuration file, and that the only way to tell Ignite to close the cursor is in the code, after queries.

Sonar-Runner talks to the local database

I am trying to understand the sonar-runner http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner. I have a central sonar server that has a database in the same host. As expected I run the sonar-runner from my clients in numerous boxes and expect them to upload data to the sonar cube.
My sonar-project.properties looks something like below
# Required metadata
sonar.projectKey=a:b
sonar.projectName=b-1.0
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=lib
# Language
sonar.language=py
# Encoding of the source files
sonar.sourceEncoding=UTF-8
# Host of the sonar url
sonar.host.url=http://myserver:9000/msde/sonar/webapp
I was expecting that my client would perform some analysis and upload data directly to the server using some web services meant for upload. I however see the following in my logs
10:42:00.678 INFO - Apply project exclusions
10:42:00.682 WARN - H2 database should be used for evaluation purpose only
10:42:00.682 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
10:42:00.755 INFO - Initializing Hibernate
Question
Should I be configuring the details of the database in the sonar-project.properties? I was expecting it to use some webservice from the sonar url to upload metrics but there are several problems with exposing the database details. I wanted the database to be internal to the server and not accessed by various clients.
This also means that I should place the database details in various property files in several projects so the cost of changing the central database details is huge.
You need to edit the $SONARQUBE_RUNNER_HOME/conf/sonar-runner.properties file to point to the correct database instance. And this is the only file you need to do that for all your projects.
If you are using MySQL, in the HOME_SONAR_RUNNER\conf\sonnar-runner.properties file, you have to uncomment the line that relates with MySQL, leaving the line as this:
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
In the same file, don't forget to comment next:
#sonar.host.url=http://localhost:9000
Save the file and run again.

How to connect to oracle from a java servlet?

I have a problem connecting to oracle from within a java servlet running in Jetty (as part of Eclipse). The identical code runs fine from a standalone java app.
My entire development environment is on a single mac. I am using Eclipse and have included the ojdbc6.jar in the main 'Referenced Libraries' and have also dragged and dropped this file in the war/web-inf/lib folder.
As soon as the line
OracleConnectionPoolDataSource ocpds = new
OracleConnectionPoolDataSource();
is called (within the servlet) I get the exception:
java.security.AccessControlException: access denied
(javax.management.MBeanServerPermission createMBeanServer)
Am I missing some security policy or so? If so, exactly what do I do need to do to rectify this? And where does this BeanServer come in?
Thanks in advance.
Every web container has its own way of defining data sources, and making them available through JNDI. You should do that instead.
The native oracle connection pool seems to be creating an MBeanServer, and this is not probably not allowed by the security manager used by Jetty. See http://wiki.eclipse.org/Jetty/Feature/Secure_Mode and http://wiki.eclipse.org/Jetty/Tutorial/Jetty-Policy.
Worked it out - not entirely clear why but created a new GWT app in Eclipse but this time NOT included the Google App Engine (which is ticked by default). This seems to add some restrictions to the code when it is running in Jetty....
I now have copied the sample code over and all is working well!

Adding a jdbc driver to pentaho design studio and configuring the datasource

I've just integrated pentaho's design studio into the BI server. Does anyone know how to add mysql jdbc drivers. I need to connect in order to define the relational action process.
In my research I found:
http://wiki.bizcubed.com.au/xwiki/bin/view/Pentaho%20Tutorial/Install%20Pentaho%20Design%20Studio#Comments
which specifies selecting
JDBC Driver, Edit, Extra Class Path from Preferences but no such preference exists,
http://forums.pentaho.com/showthread.php?85148-Design-Studio-xaction-database-connection-dropdown-list-empty&highlight=add+jdbc+driver+to+design+studio
which resulted in me creating a jdbc folder in which I placed the drivers in plugins\org.pentaho.designstudio.editors.actionsequence_4.0.0.stable\lib\
but just as the author of the thread I'm stuck
http://forums.pentaho.com/showthread.php?53303-Create-a-new-datasource&highlight=add+jdbc+driver+to+design+studio
suggests that:
3. If you are using the Pentaho DesignStudio you have to copy your jdbc (JAR files) to the plugins directory (in pentaho plugin) so you can develop, deploy and run your applications. This apply also to eclipse plugin (If you have now an Eclipse).
Which resulted in me placing the jar files in the plugin directory to no avail.
http://forums.pentaho.com/showthread.php?53715-Can-t-add-new-datasource-GA-version&highlight=add+jdbc+driver+to+design+studio
talks of a directory, rdw which does not exist
Any form of assistance will be greatly appreciated.
You have to configure the datasource by adding a Relational Process Action to your .xaction in the Pentaho Design Studio wherein you can specify the JDBC Driver, Username, Password and the Database URL. But first you have to put your MySQL JAR file in your lib folder /path/to/biserver-ce/tomcat/lib
You will also have to save your *.xaction file/s in the pentaho-solutions folder /path/to/biserver-ce/pentaho-solutions in order for your *.xaction files to connect to the database which you have assigned in your Relational Process Action.
I encountered the same problem and solved as follow
place mysql-connector-java-5.1.17.jar under (bi server path)\tomcat\lib\ folder
start Pentaho Admin Console (PAC) http://127.0.0.1:8099 with
user: admin
password: password
and add a connection there
use the name of the connection just created for action sequence as JNDI
The problem solved for me.

Resources