tag:blogger.com,1999:blog-8712770457197348465.post6812695472915131916..comments2024-03-19T01:04:48.783-07:00Comments on Javarevisited: Java Program to connect Oracle Database with Example - JDBC Tutorial Sample Codejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-8712770457197348465.post-56010410568308892192017-12-21T00:52:18.836-08:002017-12-21T00:52:18.836-08:00can you help me my code was successfully run but n...can you help me my code was successfully run but not display output on command prompt<br />what i can do?plz help me<br />import java.sql.*;<br />import java.sql.DriverManager;<br />import java.sql.Connection;<br />import java.sql.SQLException;<br />import java.sql.ResultSet;<br />import java.sql.Statement;<br />class OracleCon<br />{<br />public static void main(String args[])<br />{<br />try<brvigneshhttps://www.blogger.com/profile/14827103383704541990noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-35718864291884177882017-02-05T21:41:26.428-08:002017-02-05T21:41:26.428-08:00In Java8, How to connect the database now, once JB...In Java8, How to connect the database now, once JBDC ODBC driver is removed.arvind dhariwalhttps://www.blogger.com/profile/05351030053345517728noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-21960044601334846652016-07-31T23:10:52.498-07:002016-07-31T23:10:52.498-07:00even i am set classpath to ojdbc6,i am getting the...even i am set classpath to ojdbc6,i am getting the error sun.jdbc.odbc.JdbcOdbcDriver not founAnonymoushttps://www.blogger.com/profile/02557875292853880286noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-45534001462360473612016-02-19T22:37:31.372-08:002016-02-19T22:37:31.372-08:00@Bapan, did the "he Network Adapter could not...@Bapan, did the "he Network Adapter could not establish the connection" goes away or it still there. What is the "orcle" in your connection URL. You should also check if any of following format work:<br />jdbc:oracle:thin:user/xxxx@server:port:SID<br />jdbc:oracle:thin:user/xxxx@:SID<br />jdbc:oracle:thin:user/xxxx@//server:port/XE<br /><br />javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-30664861718632162482016-02-19T21:14:11.828-08:002016-02-19T21:14:11.828-08:00Connection con = DriverManager.getConnection("...Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcle","system","Infy1234");<br /><br /><br /><br />The connection is in my localhost. still i am getting the same error. Pleas give a solution.Anonymoushttps://www.blogger.com/profile/03975560893620416284noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-50985485314115256712016-02-17T21:21:14.761-08:002016-02-17T21:21:14.761-08:00It says "IP address must be specified." ...It says "IP address must be specified." Still got same error. host and port are correct.<br /><br />Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcle","system","Infy1234");<br /><br />Anonymoushttps://www.blogger.com/profile/03975560893620416284noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-55874337428425396152016-02-17T03:29:21.104-08:002016-02-17T03:29:21.104-08:00Please check if host and port is correct. You can ...Please check if host and port is correct. You can try ping/telnet on that host and port from your host and see what it says.javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-43020324524132790872016-02-16T20:56:25.738-08:002016-02-16T20:56:25.738-08:00Can you please tell me why I am getting error belo...Can you please tell me why I am getting error below. When I was run the program I got that error.<br /><br />package com.java.test;<br /><br /><br /><br /><br />import java.sql.Connection;<br /><br />import java.sql.DriverManager;<br /><br />import java.sql.SQLException;<br /><br /><br /><br /><br />public class DatabaseTest {<br /><br /> public static void main(String[] args) {<br /><br />Anonymoushttps://www.blogger.com/profile/03975560893620416284noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-16568770678017753332015-02-03T20:33:07.870-08:002015-02-03T20:33:07.870-08:00If anyone has any trouble finding ojdbc6.jar e.g. ...If anyone has any trouble finding ojdbc6.jar e.g. not able to download from internet or internet is not available. Always remember that one copy of this JAR is available when you install Oracle Client or Server in your machine. You can find this JAR in following location :<br /><br />$ORACLE_HOME/jdbc/lib/ojdbc6.jar<br /><br />Also JDBC Connection URL for Oracle can take variety of format e.g. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-49609078399318596532014-08-07T21:07:18.336-07:002014-08-07T21:07:18.336-07:00If you using eclipse , than change the program pro...If you using eclipse , than change the program properties to jdk 1.6/7 Prasannahttps://www.blogger.com/profile/06131469975478810387noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-84400448735697312742014-06-29T07:32:58.559-07:002014-06-29T07:32:58.559-07:00import java.lang.Exception;
import java.sql.Connec...import java.lang.Exception;<br />import java.sql.Connection;<br />import java.sql.DatabaseMetaData;<br />import java.sql.DriverManager;<br />import java.sql.SQLException;<br />public class java<br />{<br />static String url ="jdbc:odbc:vinn";<br />static Connection con =null;<br />public static void main(String[] args) throws SQLException {<br />Connection con =getOracleJDBCConnection()Er. Abhay Mishranoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-19290378908520677762014-01-07T23:17:50.060-08:002014-01-07T23:17:50.060-08:00I am not able connect using JDBC thin driver. It g...I am not able connect using JDBC thin driver. It gives me a error ORA-01756 'Quoted string not properly terminated' which does not seem relevant. I am only trying to establish a database connection and not executing any SQL statement. Any thoughts?samhttps://www.blogger.com/profile/02007244638385281449noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-71320754961816482362013-09-01T22:28:52.861-07:002013-09-01T22:28:52.861-07:00C:\Users\Sarveshwar\Desktop>javac -cp E:\app\Sa...C:\Users\Sarveshwar\Desktop>javac -cp E:\app\Sarveshwar\product\11.2.0\dbhome_1\jdbc\lib\ojdbc5_2.jar;C:\User\Sarveshwar\Desktop OracleJdbcExample<br />error: Class names, 'OracleJdbcExample', are only accepted if annotation processing is explicitly requested<br />1 error<br /><br />C:\Users\Sarveshwar\Desktop>javac -cp E:\app\Sarveshwar\product\11.2.0\dbhome_1\jdbc\lib\ojdbc5_2.jarSarveshwarhttps://www.blogger.com/profile/00811457146982689254noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-8475787651455413682013-08-28T21:54:09.604-07:002013-08-28T21:54:09.604-07:00How to set the classpath to ojdbc6.jar in solaris ...How to set the classpath to ojdbc6.jar in solaris OS??? People please help me out..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-65032326551083132242013-07-04T00:29:06.965-07:002013-07-04T00:29:06.965-07:00I've set the class path for driver in .bashrc ...I've set the class path for driver in .bashrc but it still says "No suitable driver found"Anonymoushttps://www.blogger.com/profile/08179523101061386483noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-59258017705119142952013-03-14T07:18:46.790-07:002013-03-14T07:18:46.790-07:00Download ojdbc6.jar and import it to the classpath...Download ojdbc6.jar and import it to the classpath. This would resolve the issue.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-53339489409766713402013-02-19T03:00:05.298-08:002013-02-19T03:00:05.298-08:00when i write code of line to register the driver ...when i write code of line to register the driver <br />DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());<br /><br />i found the error like this<br /><br />The constructor JdbcOdbcDriver() is not <br /><br />accessible due to restriction on required library <br /><br />C:\Program Files\Java\jre6\lib\rt.jar<br /><br />please help?Anonymoushttps://www.blogger.com/profile/16979391456075965189noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-19159311542729492742013-01-27T01:41:39.128-08:002013-01-27T01:41:39.128-08:00Class.forName("driver") is not needed in...Class.forName("driver") is not needed in Java 6 and higher :) Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-15394115078097423622012-12-21T10:49:51.430-08:002012-12-21T10:49:51.430-08:00but how set thin driver in classpath but how set thin driver in classpath Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-5791052604281635502012-12-11T14:04:47.133-08:002012-12-11T14:04:47.133-08:00don't we have to load the driver using Class.f...don't we have to load the driver using Class.forName("driver") Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-79301981952580037552012-06-17T22:56:47.842-07:002012-06-17T22:56:47.842-07:00is there any difference when you connect to Oracle...is there any difference when you connect to Oracle 10g or 11g database ? do I need to change JDBC driver for Oracle 11g datbase?Anonymousnoreply@blogger.com