Am trying to connect to database using thin driver am getting an erro
Hi,
Am trying to connect to database using thin driver am getting an error.may i know the exact problem. If any one provide the solution in steps wise better.The following is the error.
Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.oracledriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at JdbcEx.main(JdbcEx.java:15)
Thanks
sreekanth
Am trying to connect to database using thin driver am getting an error.may i know the exact problem. If any one provide the solution in steps wise better.The following is the error.
Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.oracledriverThe JAR file is not in your classpath. Depends on what JAR you are using (ojdbc14.jar, ojdbc5.jar, etc). Bottom line, it can't find the class for the driver due to the JAR not being in the classpath.
Similar Messages
-
I am unable to connect to oracle using thin driver
Hi,
I am writing a program to connecto database using thih driver,by using ipadress of server where oracle 8i is installed.I am getting an error
Exception in thread "main" java.sql.SQLException: No suitable driver
How to over come this.Any one please help me.I am getting error saying No suitable driver found
this is my function:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.112:1521:orcle8i","scott","tiger");
oracle 8i is my database name.I have created another database name with oracle in the server. will it cause any problem. -
Error while trying to connect to Database using Oracle instantclient
I have a linux box where i have downloaded"instantclient-basic-linux.x64-11.2.0.3.0.zip". I have unzipped in /opt/instantclient_11_2.
I am using this as a client in my code for connecting to the oracle 11g database which is in a different server. I have set the below env variables.
LD_LIBRARY_PATH=/opt/instantclient_11_2
CLASSPATH=/opt/instantclient_11_2:...
PATH=/opt/instantclient_11_2:...
When i run my program i am getting the below error.
java.sql.SQLException: ORA-12154: TNS:could not resolve the connect identifier specified
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:765)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:414)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:162)
I am trying to connect through a thick client as below.
Class.forName ("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@hostname_orcl", userid, pwd);
I have seen in some forums that we need to set $ORACLE_HOME and $TNS_ADMIN env variables as well. But, here i am trying to connect to a remote database. what should i set these variables to as i don't have oracle in my machine??
Thankslooks like you didnt complete the install of the instant client. the ORACLE_HOME and TNS_ADMIN points to the location of the tnsnames if you dont have the full tns string in your jdbc connection string
https://kb.berkeley.edu/jivekb/entry.jspa?externalID=1826 -
Cant connect my database using net service_name
Good Morning to all;
I trying to connect my database using net service_name , but i am getting error.
I have tnsnames.ora entry and listener.ora entry.
Please help me to crack this error.
SQL> select name from v$database;
NAME
ORCLTEST
SQL> grant connect ,resource to u1 identified by u1;
Grant succeeded.
SQL> grant sysdba to u1;
Grant succeeded.
SQL> show parameter pass;
NAME TYPE VALUE
remote_login_passwordfile string EXCLUSIVE
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
From DBS Directory :
[oracle@linuxserver dbs]$ orapwd file=orapworcltest password=asdf1234 entries=3
export ORACLE_SID=orcltest
[oracle@linuxserver ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 9 19:24:22 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR when trying to connect
SQL> conn u1/u1@ORCLMYTEST
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
SQL> conn u1/asdf1234@ORCLMYTEST
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Thanks in advance ..Can i connect my database using username/password@netservice_name ?
Yes, you should. Please post the result of "lsnrctl stat LISTENER_ORCL".
*[oracle@linuxserver admin]$ lsnrctl stat LISTENER_ORCL*
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 19:58:18
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linuxserver)(PORT=1521)))
STATUS of the LISTENER
Alias LISTener_ORcl
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 09-MAR-2013 11:10:14
Uptime 0 days 8 hr. 48 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener_orcl.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxserver)(PORT=1521)))
Services Summary...
Service "MYDB.PROD.ORCLPROD.COM" has 1 instance(s).
Instance "orclprod", status UNKNOWN, has 1 handler(s) for this service...
Service "MYDB.TEST.ORCLTEST.COM" has 1 instance(s).
Instance "orcltest", status UNKNOWN, has 1 handler(s) for this service...
Service "asdf" has 1 instance(s).
Instance "asdf", status READY, has 1 handler(s) for this service...
Service "asdfXDB" has 1 instance(s).
Instance "asdf", status READY, has 1 handler(s) for this service...
Service "asdf_XPT" has 1 instance(s).
Instance "asdf", status READY, has 1 handler(s) for this service...
Service "orclprod" has 1 instance(s).
Instance "orclprod", status READY, has 1 handler(s) for this service...
Service "orclprodXDB" has 1 instance(s).
Instance "orclprod", status READY, has 1 handler(s) for this service...
Service "orclprod_XPT" has 1 instance(s).
Instance "orclprod", status READY, has 1 handler(s) for this service...
Service "orcltest" has 1 instance(s).
Instance "orcltest", status READY, has 1 handler(s) for this service...
Service "orcltestXDB" has 1 instance(s).
Instance "orcltest", status READY, has 1 handler(s) for this service...
Service "orcltest_XPT" has 1 instance(s).
Instance "orcltest", status READY, has 1 handler(s) for this service...
The command completed successfully -
Getting exception while trying to connect mysql database
hi
i am using mysql as database while connecting to database using jsp i am getting the following exception
"java.lang.ClassNotFoundException:com.mysql.jdbc.Dr iver"
can any one tell wha tis the actual problem
regardsIf you've tens of applications on the server which
makes use of the same driver/JAR, then you can put
this JAR in the classpath of the server to save
WAR/EAR space. And about differing versions: I am not
used to do so. Otherwise just put the different/older
version in the classpath of the webapp and then give
it higher priority in the classloader.If you are using Enterprise Applications, disk space for the code should be your last concern. If you don't have enough of that for each of the applications to have their own space for the third party jars that they use, then you need a new server, as the one you have is not going to be able to handle the load anyway.
And as far as fiddling around with the classpath to avoid jarfile "collision" or incapability, good luck. The first time you add a new application all the others will stop working and you will have to spend two days reordering the classpath properly, so that they all work again. I know, because I have seen it happen, even though I suggested to them to do it the other way, they insisted on doing things the way you suggested and, like I said, as soon as they added the next application, the server was down for two days, until they got all of the classpath/(classloader priority) issues straightened out. -
Error while trying to export my database using this command
Hi,
I am trying to export my database using this command :
expdp system/manager@db1 full=n schemas=kul4231 dumpfile=kul4231_20091122.dmp logfile=kul4231_20091122.log directory=dump_dir1
Error:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31637: cannot create job SYS_EXPORT_SCHEMA_05 for user SYSTEM
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT_INT", line 600
ORA-39080: failed to create queues "KUPC$C_1_20091122101110" and "" for Data Pump job
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPC$QUE_INT", line 1606
ORA-01008: not all variables bound
DB version : Release 10.2.0.4.0
all ideas are welcomed!!!!!!!!!!!! let me know where am i going wrong!!!!!!!
thanks in advance..!!!!!!!!
venkat.What is your SGA settings? (especially streams_pool_size).
You can try to bump streams_pool_size to 100M if your current setting is below that.
Regards
Tomasz K. -
Not able to connect to database using toad
we have a 11.1.0.7 database on solaris machine.
when the development team tries to connect to it using toad, it gives them ORA-01017: invalid username/password error.
We are using TNS entries to connect. From the same client machine, we are able to connect using SQLPLUS and SQL Developer using the same TNS entry. However, its not working on TOAD.
Toad Version is 9.0.1. Any help is much appreciated.
Thanks.Hi Muneer,
My answer is arriving to this forum late, but I'll tell you what is happening to benefit others who have this issue. Older versions of Toad convert the case of the password to upper case when they attempt to authenticate to Oracle. Versions of Oracle prior to 11G had case insensitive passwords so it did not matter. But when 11G came out with it's case sensitive passwords, Toad could no longer authenticate. You can test this yourself by modifying the password for your Oracle account (usnig sqlplus) so that the password is completely upper case.....Toad will suddenly be able to authenticate.
You will find that sqlplus and SQL Developer don't have a problem. That is because they don't convert the password to upper case, they just leave it as it is. I don't know why older versions of Toad convert the password to upper case, but that is what they do. Newer versions of Toad fix the issue. I believe that Toad versions 9.5 and later should work. I've also read, however, that 9.5 had issues with Oracle 11G client libraries so you might just want to upgrade to the latest/greatest version of Toad. -
Ora-12154 when trying to connect to database from fortran application
I am trying to connect to database and run an simple select query to a table(without any where clause) using pro*fortran code.
the connect strng is like
exec sql connect :uidpwd
where uidpwd = username/password@SID
SID and tnsnames connect string are the same.
The fortran (profortran) code is placed in the database server and there are no errors when make is run.
Tnsping is working fine, also i am able to conect using sql*plus and run the same query.
Please help
Thanks and Regards
NitinHi Nitin
Thanks for the helpful! With your point I'm now Pro! Great thanks.
By the way have your seen that?
Files such as LISTENER.ORA, TNSNAMES.ORA, SQLNET.ORA, if configured manually, or copied and edited from earlier releases of Oracle Database may have record attributes that are incompatible with Oracle Database 10g release 2. The software cannot read such files. The required record format is stream_lf and the record attributes are carriage_control and carriage_return.
This may result in:
Inability to start the listener
Services not registered with the listener
Inability to connect to other databases
ORA-12154: TNS:could not resolve service name
Run the following command on each file affected:
$ DIR/FULL filename
An output similar to the following may be displayed:
Record format: Variable length, maximum 255 bytes
Record attributes: Carriage return carriage control
If the output includes the preceding entries, then run the following command:
$ CONVERT/FDL=SYS$INPUT filename filename
RECORD
CARRIAGE_CONTROL CARRIAGE_RETURN
FORMAT STREAM_LF
^Z
Otherwise herewith an interesting metalink note. Doc ID: Note:437597.1
Subject: Ora-12154 When Executing Pro*Fortran Code Compiled With Oracle 10g.
Hope this will also help you...
Cheers
Hubert -
Not able to connect to database using jdbc
Respected sir/madam,
I am new to java and i am trying to connect to database which is necessary for me in project when i wrote the code using class.forName i am able to compile but when runnig i am getting two exceptionns one is oracle.jdbc.driver.oracledriver not found or excetion in thread main class not found please help meSubash,
1) Please refrain from cross-posting (posting the same message into two or more forums). This question was better asked in the JDBC forum as you eventually put it but you already posted here so if that happens again next time just leave the original thread be.
2) Your compilation classpath and your runtime classpath are not related. As a matter of fact with well written JDBC code and under most conditions you should not need your driver in your compilation classpath at all, only your runtime one.
3) Your driver is not in your runtime classpath. That is the error that you need to resolve. -
Connecting with database using setproperty over SOAP connection
The following method connects to a MySQL database.
public void setDBDriverName(String in)
dbDriverName = in;
public void setDBConnection(String in)
dbConnection = in;
public void connectToMySQLDatabase() throws SQLException
if(dbCon == null)
try
Class.forName(dbDriverName); // SQL driver
dbCon = DriverManager.getConnection(dbConnection); // JDBC url
s = dbCon.createStatement();
catch (Exception e)
System.out.println("Could not connect to database using " + dbConnection + " at " + dbDriverName + " : " + e.getMessage());
else
System.out.println("Could not connect to databse : Already connected");
}The method is part of a webservice, in which I use setproperties to set the database connection because the webservice must work with different types of databases like Oracle and MySQL.
<jsp:useBean id="ContactHistorieClassid" scope="request" class="proxy.soap.ContactHistorieClassProxy" />
<jsp:setProperty name="ContactHistorieClassid" property="DBConnection" value="org.gjt.mm.mysql.Driver" />
<jsp:setProperty name="ContactHistorieClassid" property="DBDriverName" value="jdbc:mysql://localhost/contacthistorie" />
<jsp:setProperty name="ContactHistorieClassid" property="clientID" value="1" />
<%
ContactHistorieClassid.connectToMySQLDatabase();
%>What am I doing wrong here?Forgot what happens, sorry. After trying to use the ContactHistorieClassid.connectToMySQLDatabase() method, my server console tells me that it cannot connect to the database, even though it returns the values as they were set in the setproperty.
When I manually enter the values like this...
Class.forName("org.gjt.mm.mysql.Driver"); // SQL driver
dbCon = DriverManager.getConnection("jdbc:mysql://localhost/contacthistorie"); .. it works properly. So the setproperties are executed as the should be. -
Cannot connect local database using net service_name
Good Morning to all ;
FYI : This question wrongly posted under high availability. Now it was removed from there.
I am trying to connect my local database using remote authentication.
but getting error. Client & Server reside on same server.
SQL> conn u1/u1@primdb
ERROR: ORA-12545: Connect failed because target host or object does not exist
SQL> conn / as sysdba
Connected.
SQL> show parameter db_name;
NAME TYPE VALUE
db_name string primary
SQL> show parameter service_names;
NAME TYPE VALUE
service_names string mydb
SQL> show parameter db_domain;
NAME TYPE VALUE
db_domain string primary.com
SQL> show parameter global_name;
NAME TYPE VALUE
global_names boolean FALSE
SQL> select * from global_name;
GLOBAL_NAME
PRIMARY
[oracle@localhost admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-JAN-2014 16:32:08
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel5.linuxserver)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Listener failed to start. See the error message(s) above...
my listener.ora file contents :
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = primary)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(GLOBAL_DBNAME = mydb.primary.com)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel5.linuxserver)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
my tnsnames.ora contents
primdb=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST= oel5.linuxserver)(PORT=1521))
(CONNECT_DATA =
(SERVER=DEDICATED)
(SERVICE_NAME = mydb)
$ tnsping primdb
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 18-JAN-2014 16:40:55
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST= oel5.linuxserver)(PORT=1521))) (CONNECT_DATA = (SERVER=DEDICATED) (SERVICE_NAME = mydb)))
TNS-12545: Connect failed because target host or object does not exist
Thanks in advance ..Good Morning Ed Stevens ;
Nice to see you once again !
I remember , you are very familiar with oracle net services.
I read your article. Exploring the LOCAL_LISTENER parameter
Now i have removed listener.ora & tnsnames.ora files .
now the listener is registered as dynamically'
SQL> alter system register;
Ed Stevens wrote ..
simply do a "ping oel5.linuxserver" and report the result.
$ ping oel5.linuxserver
ping: unknown host oel5.linuxserver
$ hostname
localhost.localdomain
$ echo $ORACLE_HOSTNAME
oel5.linuxserver
my new tnsnames.ora contents
primdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel5.linuxserver)(PORT=1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb)
$ tnsping primdb
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 18-JAN-2014 19:57:13
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oel5.linuxserver)(PORT=1521)))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb)))
TNS-12545: Connect failed because target host or object does not exist -
Packet received fails when trying to connect to database
Dear experts,
i always received an error message: Packet Received Failed whenever i tried to connect to my 9i database. Once a while i will b able to connect without problem but sometimes is very annoying that i keep receiving this error and i have to retries a lot of time to connect depending on my luck.
Does anyone have any idea what could be wrong here?
Many thanks in advance for your advise.me, too.
I installed Oracle 10g for windows on PC1
and Developer/2000 Forms 5.0.6.8 + sql*net client 2.3.4.0.0 on PC2
When I tried to connect to database by using SQL*Plus 3.3.4.0.0 the first time to connect is ok (but not fast as normal situation)
after disconnect the SQL*Plus and tried to made another connection immediately, the [ORA-12637 packet receive failed] appears.
after sometime, it may be success to connect again.
I used to disable all Firewall and the problem still happen.
Any one can help please? -
I just got an iphone and am trying to connect it to my itunes account. Getting the message " This iphone cannot be used because the Apple Mobile Device service is not started. How do I start it? Have already been back to the store with it and no change.
http://tinyurl.com/3hs3g2u
-
How to connect to database using sqlplusW (windows based sqlPlus)
Hi
Thank you for reading my post
I did some search and i find that i should use some kind of SYSTEM/SYSTEM@ORCLE
to connect to database using windows based sqlplus.
in the above SYSTEM is username and password and ORCLE is SID.
but sqlplusw says that
could not resolve the connect identifier specified.
where i can find complete information about HOST string ?
thanksYou can look inside yours tnsnames.ora file it can be found in %ORACLE_HOME%\network\admin
MOB92 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = MOB92.world)
Here my network service name in MOB92 so in sqlplus I would use:
system
password
mob92
and it should work. If you have no such entry in tnsnames.ora file you can use for example Network Configuration Assistant to configure your network service name.
Best Regards
Krystian Zieja / mob -
How to connect oracle database using jsf
how to connect oracle database using javaserver faces with connection pooling
Here is one way...
http://jakarta.apache.org/commons/dbcp/
Maybe you are looking for
-
How to find out who has changed the SYSADMIN password?
Hi, Is there a way to trace who has changed the SYSADMIN password in an instance? Regards, Neeraj
-
Internal Order Report - For the documnets when the cost ele. was not create
Hi, We created internal orders for tracking capital expenditure relating to assets. At that time, we were not created asset GL's as cost element. Recently we created asset GL's as cost elements (category 90). Now we are getting the internal order rep
-
Add new fields using BADI DNO_EVENT_SAVE in Solution Manager
Hi, I would like to add new fields using BADI DNO_EVENT_SAVE. How can I add new fields? Thanks.
-
Numbers suitable for xls files?
Is it possible to import Excel files in Numbers and subsequently work on them? If not, which app should I use?
-
Why do some contacts show up in red
I had an iPad before I had an iPhone. I used to send text messages to my whole list of contacts until I started using my iPhone. After I synced the contacts from my iPad to my iPhone I can no longer send messages to those of my contacts without an