HSQL SQLTool cant connect - java

I get the following:
java -jar ./sqltool/sqltool.jar inlineRc=url=jdbc:hsqldb:hsql://192.168.99.100/test,user=sa
Please enter password for sa!:
SqlTool v. 5337.
Can't connect to jdbc:hsqldb:hsql://192.168.99.100/test for user "org.hsqldb.jdbc.JDBCDriver"!
Reason: org.hsqldb.jdbc.JDBCDriver
I am using sqltool.jar in version 2.3.3. Anybody got a workaround or explaination?

Running SQLTool in this manner requires the hsqldb.jar to be in the same directory as the sqltool.jar.
The error message indicates it cannot find the HSQLDB's JDBC driver, which is in the hsqldb.jar.

Related

Connecting Java app with Oracle on Mac osx [duplicate]

I am trying to connect my grails project to Oracle databse(Oracle 12c) in windows(8) system. However, whenever I run my application I get following exception :
Caused by: org.apache.commons.dbcp.SQLNestedException:
Cannot create PoolableConnectionFactory (ORA-28040:
No matching authentication protocol)
Caused by:
java.sql.SQLException: ORA-28040:
No matching authentication protocol
According to internet suggestion I also tried editing my *.ora file but it is not working.
I added following snippet in sqlnet.ora file :
SQLNET.ALLOWED_LOGON_VERSION=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
Here i tried assigning (10,11,12) but neither of them is working.
Can anyone please help me with this ?
I deleted the ojdbc14.jar file and used ojdbc6.jar instead and it worked for me
Here is some text I found at experts-exchange:
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION
parameter has been updated to 11. This means that database clients
using pre-11g JDBC thin drivers cannot authenticate to 12.1 database
servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the
old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to
fail with the ORA-28040: No matching authentication protocol error in
12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the
oracle/network/admin/sqlnet.ora file.
This except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
If you get "ORA-01017: invalid username/password; logon denied" error, then you need to re-create your password.
I resolved this issue by using ojdbc8.jar.
Oracle 12c is compatible with ojdbc8.jar
I was using eclipse and after trying all the other answers it didn't work for me.
In the end, what worked for me was moving the ojdb7.jar to top in the Build Path. This occurs when multiple jars have conflicting same classes.
Select project in Project Explorer
Right click on Project -> Build Path -> Configure Build Path
Go to Order and Export tab and select ojdbc.jar
Click button TOP to move it to top
Very old question but providing some additional information which may help someone else. I also encountered same error and I was using ojdbc14.jar with 12.1.0.2 Oracle Database. On Oracle official web page this information is listed that which version supports which database drivers. Here is the link and it appears that with Oracle 12c and Java 7 or 8 the correct version is ojdbc7.jar.
In the ojdbc6.jar is for 11.2.0.4.
Except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
I also added the following to both the Client and Server, which resolved my issue
SQLNET.AUTHENTICATION_SERVICES = (NONE)
Also see post
ORA-28040: No matching authentication protocol
Adding
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
is the perfect solution
sql.ora directory
..\product\12.1.0\dbhome_1\NETWORK\ADMIN
My Initial error is : ORA-28040: No matching authentication protocol exception
My DB version is 12.2 (Solaris) and client version is 11.2 ( windows). I have added below in both server and client sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
while connecting, I have got invalid username and password hence I have recreated the password ( same password ) in database which is resolved my issue.
While for most cases replacing ojdbc driver jar will be the solution, my case was different.
If you are certain you are using correct ojdbc driver. Double check if you are actually connecting to the database you are thinking you are. In my case jdbc configuration (in Tomcat/conf) was pointing to different database that had different Oracle version.
just install ojdbc-full, That contains the 12.1.0.1 release.

Error connecting to Hive using JayDeBeApi - Class not found

I am trying to connect to my Hive server using JDBC connection.
I've the following JAR file in my JAVA_HOME:
HIVEJDBC41.jar
hadoop-common.jar
But when I run my code jaydebeapi.connect('org.apache.hive.jdbc.HiveDriver', url)
It gives me the following error:
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class org.apache.hive.jdbc.HiveDriver not found
Note: My connection needs to be using JDBC connection.
Anyone knows what I am missing?
There is mismatch of JDBC jar version
try hive-jdbc 2.3.7

How to add mysql connector to Sqoop 1.99.3

I have installed Hadoop & connected with Hadoop locally successful. I can connect the Sqoop via REST api and via cli interface.
But once I want to start creating a job for important data from MySQL. It shows
Connection configuration Warning message: Can't connect to the
database with given credentials: No suitable driver found for
jdbc:mysql://127.0.0.1:3306/for
Error message: Can't load specified driver
after google its solution, I has already
put the mysql-connector.jar to sqoop web lib folder
create a lib folder under the sqoop folder and put the mysql-connector.jar in it
I also have restarted or even reboot my VM. It still says cannot load specified driver.
Is there any config files I have missed to set? Thank you!
My ENV:
VirtualBox + Vagrant + Ubuntu 12.04
JDK (Sun Distrubution 1.7_update 51)
Hadoop 2.2.0 (complied version)
Sqoop 1.99.3 (complied version)
Thank again!
check your 'JDBC Driver Class' of the connection you just created in sqoop,it should be setted
as com.mysql.jdbc.Driver.
If still not work,put mysql-connector-java-3.1.12-bin.jar into $SQOOP_HOME/server/lib

SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbname

I've inherited a project (and I have absolutly no experience of Java) and I'm rather stuck.
We have a server running redhat, which I needed to update one of the jar files. So I simply copied up the updated file and restarted the service for that file. However this process has worked on our other server I did that too but on this one it comes up with the below in the log file.
Exception: com.mysql.jdbc.Driver
SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbanme
The jar files are uploaded to a folder in the root of the website and within that jar folder is a lib folder where mysql-connector-java-5.1.6-bin.jar is located.
Does anyone know what I could be missing as I'm a newbie to linux aswell.
Thanks in advance
java.sql.SQLException: No suitable driver found
This exception can have 2 causes:
The JDBC driver is not loaded at all.
URL does not match any of the loaded JDBC drivers.
Since the driver seems to be loaded , it look like that the URL is not valid on that machine:
jdbc:mysql://localhost:3306/dbname
Do you have mysql running and listening on port 3306 on that machine. Also make sure you hte schema dbname there.
You need only set that:
[jdbc:mysql://localhost/dbanme]
instead of
[jdbc:mysql://localhost:3306/dbanme]
Because java compiler default understand a port 3306, so no need to fill "3306" after "localhost:"

sqlj runtime error

Could somebody tell me what is causing this error when using sqlj in Oracle 11g. I am using Solaris 8 and I have tried changing JDK versions (tried both 1.5 and 1.6).
bash-2.03$ ~/11.2.0.2/bin/sqlj -compile=false -classpath '~/11.2.0.2/sqlj/lib/translator.jar:~/11.2.0.2/sqlj/lib/runtime12.jar'
Exception in thread "main" java.lang.NoClassDefFoundError: sqlj/runtime/profile/DefaultLoader
at sqlj.tools.Sqlj.resetStaticVariables(Sqlj.java:2905)
at sqlj.tools.Sqlj.statusMain(Sqlj.java:189)
at sqlj.tools.Sqlj.main(Sqlj.java:150)
The same command works fine with Oracle 10g:
bash-2.03$ ~/10.2.0.3/bin/sqlj -compile=false -classpath '~/10.2.0.3/sqlj/lib/translator.jar::~/10.2.0.3/sqlj/lib/runtime12.jar'
Error: This SQLJ runtime must be run under an Oracle JDBC driver.
Thanks,
Raj
According to this site the runtime12.jar should contain this class - so the question is - did you try running ls ~/11.2.0.2/sqlj/lib/runtime12.jar to verify the path exists?

Categories

Resources