Connecting Oracle Database 11g Express Edition to Eclipse - eclipse

I just installed Oracle Database 11g Express Edition.
In the Run SQL Command Line window I connected to database with username:SYSTEM and password:{password I selected during installation}
SQL>connect SYSTEM/{password}
Then I created a user with password as described in the documentation. After that, I am able to access the database i.e. creating and querying tables and info.
Now, I want opened latest Eclipse EE and opened a Database Development perspective. In the Data Source Explorer, I right clicked and selected New Connection. In the driver definition, I added the jar file ojdbc6.jar which is provided in the oracle installation.
I don't know what to fill in Host, Username, and Password. I tried several combinations, and still getting ping failed. Please help, I am trying it for 3 days now and got so frustrated.

To check the host name -> ORACLE_HOME/server/network/admin
open the tnsnames.ora file with oracle developer. You will see somethimg like this-
ADDRESS = (PROTOCOL = TCP)(HOST = hostname )(PORT = 1521
now in eclipse-> windows->preferences->data management-> connectivity -> driver definition
there add oracle thin driver 11 and include necessary jars(u will find them in your \oraclehome->jdbc->lib ,then in properties in the connection url field include url with ur hostname you checked in tnsname.ora
example -jdbc:oracle:thin:#hostname:1521:xe
I know, u are welcome.. i too spent 4 days in figuring this :)

Related

Mongosqld runs fine, but ODBC fails on test and PowerBI throws error 10060. Connector not working. Windows to two seperate RHEL Servers

The Goal
I need to get data from a MongoDB updated every 15 minutes to use to build into a PowerBI report.
The Gear
I am connected from my windows machine via ssh to an RHEL server (server a). This server is running powerbi connector (SQLD) which is connected to my MongoDB that is running on a different server (server b). I'm also running MySQL on server b. My powerBI connector is installed on server b.
Exactly where I'm at
I am using the steps listed here (and all the associated pages) and have tried everything listed short of writing a config file, as the fact that things are working on mongosqld's end makes me think I don't need it... and if I can't get it working manually, having a config file won't exactly help.
https://docs.mongodb.com/bi-connector/current/connect/powerbi/
Using:
mongosqld --mongo-uri="mongodb://10.xxx.xxx.xx" --auth --mongo-username="ThisGuy" --mongo-password="test"
I successfully map the schema and show an active connection in the command window. I can also access my database from compass using an authorization enabled URL.
When I set up an ODBC connector I use the IP of server a, the user and password from my url, and port 3307. Nothing shows up in the dropdown, when I click 'test' I get the following message:
Connection Failed
[MongoDB][ODBC 1.4(w) Driver]Can't connect to MySQL server4 on '10.xxx.xxx.xxx' (10060)
I have also tried 3306, 27017, and 27015. Just to be safe I also added firewall rules for all traffic on these ports. I've tried this many times, including (just for the hell of it, and I'm kind of new to this stuff) the ip of server b, the ip of my machine, the credentials for MySQL, basically any combination of these things that I can think of.
In powerBI, my odbc driver shows up, and when selected in the dropdown, it asks for a username and password. I have tried both mongo credentials and MySQL. Not sure which I should be using?
regardless, I get the following error inside PowerBI:
Details: "ODBC: ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)
ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)"
Thoughts
I don't control either server, although I have root access, being new to this tech and company I am wary of screwing anything up that a co-worker will have to fix. I read in a different SO thread that maybe I need to downgrade the version of MySQL that is running on the server and that it could fix the problem, but I don't think that it will actually help and am afraid I might screw up something else on the server if I do this:
The C Authentication plugin was developed against MySQL 5.7.18 Community Edition (64-bit), and tested with MySQL 5.7.18 Community Edition and the latest version of MongoDB Connector for BI. The plugin is not compatible with MySQL Server or Connector/ODBC driver version 8 and later.
https://dba.stackexchange.com/questions/219550/access-denied-when-connecting-to-mongosqld-with-mysql
Maybe the problem is that server B is listening to server a on port 3307, and that there is another unknown port (not mentioned above) that my ODBC driver must be listening to? I'm not sure how to test for this when you get a step away like this.
So that's it. I'm really stuck and would love some help, I am going to try the downgrade tomorrow if nothing else shakes loose and will keep this thread updated.
Thank you for reading

SQL Developer missing a library

I'm fairly new to Oracle SQL developer. As I'm trying to make a new connection via TNS, I'm getting this error down below which I've been looking to solve for a while fruitlessly.
Error Message:
Statut : échec -Echec du test : no ocijdbc18 in java.library.path
Assuming MySQL is a typo (You are using port 1521, which is the default port for Oracle database, also its giving you ODBC error, so I assume its an Oracle database. Remember that you can connect SQL developer to a MySQL database, so please clarify if you want to connect to a MySQL database rather than Oracle) your problem is due to lack of Oracle Data Base Connector driver (ODBC). From this link download the latest version of Oracle Instant client and install it on your machine. Then define ORACLE_HOME to the path of Instant client installation (To the actual installation folder, the one that contains folders like bin, network and so on) and restart SQL Developer, then you should be good to go.
P.S. : as #thatjeffsmith has mentioned correctly in the comments, it's not necessary to have Oracle Client and/or ODBC (or similar) drivers in order to connect to an Oracle database. Using basic as the connection type and adding the correct connection info would suffice. This Article in Oracle Magazine has extensively talked about the different connection types.

Remote Database Connection Setup in Netbeans

I'm totally junior in this area :)
I have JAVA version 7 on my PC.
I want to connect my PostgreSQL database to NetBeans.
Based on my search I found that I should get JDBC driver. so I downloaded JDBC41 Postgresql Driver, Version 9.3-1100 jar files from here.
then based on what I found for connection remote Mysql, did similar changes to connect to my PostgreSQL database.
As you can see in the image, connection couldn't established.
Based on what my host says, I added my IP address to "Remote PostgreSQL Database Access" page of my host.
I'm not sure my host name is correct. I used Dedicated IP Address of my site.
Any suggestion would be appreciated. Thanks
My fault was entering wrong user name and pass instead of using user name and password of database :(

How does ODBC pull database connection details?

I currently have a Macro which is connecting to a sybase database using ODBC. It's making the connection by running the following:
Set conX = wrkODBC.OpenConnection("Connection1", , True, strConn)
where strConn = "ODBC;DSN=Server_Name;APP=Daily Task;DB=db_name;UID=uname;PWD=pwd;"
The problem I am having is that this connection is working for some Server_Name's but not others. When it doesn't work I get a Error "3146 - ODBC--call failed".
What I don't understand is where it is pulling the server details from. So for example, when using embarcadero rapid to connect to a sybase database, it will use the sql.ini file to pull the server connection details based on the server_name.
I have checked and all the Sybase Servers I am testing are in the sql.ini file and my env variables are pointing to the correct sybase version. I've checked ODBC and it is only picking up a SQL Server driver.
Can anyone please explain how ODBC pulls the server name connection details? I don't understand why it works for some server names, but not others (FYI, I have tested the uname and pwd is rapid to make sure it is correct).
Any information would be much appreciated.
So, the issue was that I was looking at my odbc connections under control panel. I should mention that I am on windows 7. What I had to do was update my ODBC connection details here:
C:/Windows/SYSWOW64/odbcad32.exe
--This is for 32bit!
This had some connections set up which is why I could connect to some servers but not all of them.

what driver to use when connecting to Oracle 10 with IBM RAD / Eclipse DTP?

I'm using IBM RAD 7.5.5 (which is basically eclipse 3.4 (ganymede) + plugins).
I'm trying to create a connection to Oracle 10 using the "Data Source Explorer" view.
When I create a new connection for Oracle, there are three "driver" options:
"Oracle 10 - Oracle OCI Driver Default"
"Oracle 10 - Oracle Thin Driver Default"
"Oracle 10 - Other Driver Default"
1 & 2 don't work for me because I need to connect to the db using a "Service Name", not an "SID". The dialog box does not give me the option of specifying a Service Name, and it does not allow me to manually specify the connection URL. (Service Name has a different URL syntax, uses a '\' instead of a ':", like so ...
With SID: jdbc:oracle:oci:#localhost:1521:the_sid
With Service Name: jdbc:oracle:oci:#localhost:1521\the_sevrice_name
So ... I want to use option #3 which allows me to specify the URL manually. The problem is I add the driver file ojdbc14.jar to the JAR list, but it keeps telling me "Invalid JAR definition; driver list not defined".
Can anyone help? I'm really stuck on this. :(
Thanks,
Rob
FYI, at long last I found a solution to my problem.
While I was never able to establish the connection with the "Service Name" using Eclipse/DTP "Data Source Explorer", I was able to establish the connection with "Service Name" using SQL Developer. Once connected with SQL Developer, I did a ...
select sys_context ('userenv','instance_name') from dual;
... to determine the database's SID.
With the SID I was able to connect with option #1 and the driver contained in ojdbc14.jar.
Thanks all, Rob
If you are stuck with a more recent version of Oracle (e.g. Oracle 12) on a recent RAD or Eclipse installation you should try to do the following:
Download the Oracle 12 ojdbc7.jar. If you are on java6 you should download ojdbc6.jar
Create a new connection
Select Oracle 12 - Other Driver Default
Press the [...] dot, remove the default ojdbc6.jar and add the jar you downloaded before
Insert database name, the url (as jdbc:oracle:thin:#server:port/service ), the username and password, check the save password box if you wish.
Click Next and then Finish. Eclipse will try to test the connection, if the driver is still giving you problems then you need to force Eclipse (or RAD) to save the connection and you can fix it later.
Now you can fix the driver properties. This step is necessary to eventually be able to call the thin client in the jar.
In the database connection list choose the new connection you just created and press right button > properties
Choose Driver Properties
Click on the delta icon (the small triangle) near the Drivers combo box.
Open the Properties tab, then edit the properties as follow:
Catalog - USER
connection url - jdbc:oracle:thin:#server:port/service
Database Name - db
Driver Class - oracle.jdbc.driver.OracleDriver
Now your connection test should be succesful.