I just discovered that NetBeans can allows a user to access databases to view, edit, and execute commands. It looks pretty cool for an IDE. If you prefer to use command line, use sqlplus or command line tool for the database. If you use Windows operating system and Oracle database, TOAD could be another option. If you are using NetBeans and prefer to stay within the IDE, you can use its database features.
To get started, here are my notes on connecting to an existing Oracle database:
1. Click on Runtime tab on the panel on the upper left side.
2. Expand Databases node
3. Right click on Drivers and choose New Driver
4. Click Add
5. Choose class12.zip file from your local file system and click Open
6. Click Ok to accept the default config
7. Right click on database and choose New Connection
8. Seect Oracle driver
9. Change <HOST> with proper host name. Change <PORT> with proper port number. And change <SID> with the proper SID value.
10. Enter a user name and password for the database.
11. Click OK
12. You should see an extra node that shows the connection you established. Expand the code and browse around. Right click on a node and see what tasks you can do.
This little discovery certainly was a pleasant surprise.
Where do we get the class12.zip file?
You can find class12.zip/class12.jar file in Oracle’s home/installed directory, under jdbc.
hello what should i have selected class 12 from here but
unable to connect what should i put under host name and port number so that it get connected
The host name and port number should be for your database server. If you installed Oracle on localhost, you can just specify the correct host name for localhost (or just “localhost”) and the port that the database server is listening.
I have generally found that columns of type Oracle type Date always appear as a Date rather than a timestamp. Therefore the time part if always missing, which is a problem if a table has a column of times!
Do you find the same thing? Or are you seeing times as well?
I am assuming you are referring to java.sql.Date. It is a child of java.util.Date and inherits methods existis in the parent. Depending on what you need to do with the data, you can try to call getTime() or use java.text.SimpleDateFormat to extract full timestamp information.
No. What I was referring to was what happens in the NetBeans database explorer. This is a user interface and not a programmatic one. You enter a SQL query and then you see in the explorer a table of results. These results do not in my experience show times, only dates.
I was wondering if you saw the same thing in the database explorer?
Thanks for the clarification. If you want to display timestamp when you query a date datatype in Oracle database, try the following SQL statement: select TO_CHAR(MYDATEFIELD, ‘DD-Mon-YYYY-HH24:MI:SS’) from “MYTABLE” See the following page for more information: http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#i170559
hi,
ur netbeans info on “Access to oracle db using nb5.5beta” was very helpful. I establishd a succesful connction to oracle db and were able to modify what i wanted to. Here is my doubt: I wanted to populate my jList with data from a column in oracle Table named “task1”. What is the procedure for connecting oracle table to my Javaprogram?? thanks in advance!!
How about this:
http://forum.java.sun.com/thread.jspa?threadID=309952&messageID=1240781
I not speak english… error “Unable to refresh children, connections is broken; Recurso não suportado”
I don’t speak Portuguese. So, I had to use an online translator for the last part of the error message. If I understood correctly, it means resource not supported. Are you using matching driver and database version? Are you trying to connect to a very new/old version of Oracle or even a different database? Did you tried to restart the IDE and try to connect again?
hi, i connected database and can u tell me tht how to use tht drivers in struts applications
I really need to know how I can connect to an Oracle database using Netbeans 5.5 as well as how to configure the necessary drivers
One other thing! How do you connect Java to MySQL?
Vijay, The only things you really to make sure happen is that datasource, connection pool get created, and the driver is loaded on the server. You might want to check out this howto for further information: http://www.netbeans.org/kb/50/quickstart-j2ee.html
Segun, Hope this blog entry is helpful to you. For MySQL, check out this howto: http://www.netbeans.org/kb/articles/mysql-client.html
I’m using NetBeans 5.5 against Oracle 9.2.0.1 through jdbc drivers classes12 and ojdbc14 (Oracle’s newest version for jdk 1.4). The single problem that I haven’t been able to solve in the Database Explorer is accessing Procedures. Access to Tables and Views seem to work fine. All attempts to expand the Procedures folder result in consumption of the cpu for about 10 minutes with no other visible results. This has been the case no matter what level of authorization I use for the connection, even schema owner as sysdba.
Hi MPierce, Looks like you found an opportunity for improvement. Please feel free to file a bug at http://www.netbeans.org/community/issues.html
hi,
i am having a problem to access the tables (that i made on oracle) through netbeans. how can i view/ show the table using netbeans…
Hi Charmie, Can you be a little more specific and share additional details about the issue you observed. Did you refresh your view into oracle in netbeans? Did you check if the tables actually get created in oracle by using oracle’s own management tools such as sqlplus?
hi master
sir i am use netbeans 6
sir how i connect my jsp project with oracle 10g and mysql
please give me step of configration
and whic jar or zip file i use and where the jar and zip file i search
please give me full idea
thank’s
aamir
how do i connect a GUI netbeans application to an oracle database??..please help me on this as soon as possible..your assistance will be highly appreciated
Here are two How-To docs. Hope this helps:
http://www.netbeans.org/kb/55/vwp-databoundcomponents.html
http://www.netbeans.org/kb/55/vwp-inserts_updates_deletes.html
somebody obtained to establish a connection with a database oracle, using netbeans 5.5?
all time that I try to expand the item “tables” is presented me the error message: Unable you refresh children, connections is broken.
Already I followed the all “how-to” I found and I did not have success;
fahim,
That’s worth another blog entry on it’s own. If I ever get a chance to do that, I’ll be happy to share.
Castro,
Does restart Netbeans help?
Hello,
i am trying to access Oracle database through Netbeans IDE 5.5. I followed the steps provided on this webpage to do so, but I am getting the following error:
Unable to add connection,cannot establish a connection to jdbc:oracle:thin:@localhost:5560:orcl using oracle.jdbc.driver.OracleDriver (Io exception: Bad packet type)
Can u plzz help me with this…
Thanks,
Amit.
Hi Amit,
Are you using the right driver? Take a look at end of this discussion: http://forum.java.sun.com/thread.jspa?threadID=533473&messageID=2604976
I followed the above steps to connect to oracle database 10g with netbeans 5.5 .I am unable to connect .Also plz tell me what is SID number.Please guide me on this
SID = System Identifier. SID is essentially the name of the Oracle instance you are running. This information is specific to your environment and only you or your Oracle DBA can specify this value.
dear Dave,
not even restarting the machine, I obtained success in to expand the item “tables”
i’m using NetBeans IDE 5.5 ( 200612070100 )
Windows XP versão 5.1 in X86
Java 1.6.0_01
p.s. after to connect, is possible to execute a command SQL without problems
if
Hi Castro,
Great to know that you have successfully opened table item. Please do try execute SQL command. I’ve done simple select statements within NetBeans. So, I would expect that shouldn’t cause problems. Then again, considering how many people expressed difficulties o this blog, I am not certain if you will not experience any more issues. So, save often and share your experiences.
Thanks,
David
http://www.ferm.techus.info
Good site! Thanks!
hi, i am using netbeans 5.5 against oracle 10g.
my problem is that i am not able to create connection. an any one help me.
Is Oracle listener running?
I have an interesting problem. I am long time NB user and understand most of the Connection issues.
I am trying to view Table details (schema) and getting “unable to explore……..:not enough privileges error”.
But on SQLPlus prompt, I can use the same user and schema and still can do desc .
What privileges NB needs to view table schema?
Hi Mandar,
You certainly has an interesting problem. I do not know the internals of NetBeans to explain what privileges it needs. Perhaps you can try one of the NetBeans’ mailing lists.
Before you write your question, you might want to try latest release of NetBeans if you didn’t already done so and make sure you have the matching driver version for your database.
Hope this helps
Sorry, but i removed the netbeans
Hi,
Good article. I was successful using the class12.zip driver to connect to the Oracle database and see the node.
My problem is when I click on a folder under that connection node to see the contents. If I click on Tables for example, I get
and hourglass with the message “Please wait…”.
Even after a long time, I don’t see anything else happening.
The hourglass stays there and I’m not able to see the tables
in that db schema.
Thanks,
Rudi
Hi Rudi,
Sounds like NetBeans is waiting to get connected. You might want to check the following:
1. Your connection configuration, such as user name, password, hostname, etc.
2. Is the server running? Is the listener running? Can your machine connect to the server directly?
3. Did you use the right JDBC driver?
4. Was there any network traffic between NetBeans and the server when you attempted to connect? (For Solaris/Linux, I use snoop/tcpdump)
Hope this helps
Hi Dave,
Thank you for your reply and suggestions. Yes, the database server and listeners are running and I can connect from sqlplus and Toad.
Actually I found the problem. It has to do with point 3 on your suggestions. The driver for Oracle 8.1.7 called class12.zip driver supports up to jdk 1.3, but I’m using jdk 1.6.
I downloaded the latest Oracle jdbc driver for 10.2.0. The file is called ojdbc14.jar. It works fine now, it connected and allowed me to see the tables and objects.
Now I’m trying to figure out if file produced in NetBeans can run with IIS instead of Tomcat of if something needs to be installed in IIS for the files to work. Any helps is appreciated.
Thanks,
Rudi
Assuming you are using Java (although NetBeans also support c/c++ and Ruby), I don’t know if IIS supports Java EE web applications or not. I assume no. You can’t run Tomcat or glassfish or one of the Java EE containers on the Server?
i success fully configure database in my NetBeans , i would like to know how to use that connection in my servlet or javabean , how can use that datasource in my code
I used NetBean’s wizard to create new Entity class from Database, which will trigger creation of Persistence Unit that will utilize the database configuration you just created. This should lead to automatic creation of Java objects that maps to your database.
i configured oracle database in NetBeans tool , pls help me to write to code to get Connection obj
See this tutorial: http://www.netbeans.org/kb/55/persistence.html
Hi,
I use NetBeans 5.5, Oracle 9. The connection with db ok, but i can only see views, functions but not the tables. If I try to see the tables I get “unable to refresh children connection is broken”.
Can you help me?
Hi Natalie,
Here are a few follow-up questions. Hope they are helpful.
Have you tried NetBeans 5.5.1?
Did you use the driver that came with Oracle 9 installation/distribution?
Does the user has permission to view the table when you login using a different tool such as sqlplus?
To get better idea about the issue you are facing, you might want to check out /.netbeans/5.5/var/log/messages.log and see if there is anything interesting right at the point or before your connection error.
Hi Dave,
Here are my answers.
I use NetBeans 5.5.1.
I use the newest ojdbc14.jar (Oracle Database 10g Release 2 (10.2.0.3)).
I have Connection to db, can execute all statements.
The only problem I can not see the tables in runtime.
My problem is, I try to create Persistence -> Entety Class from Database and have no tables in the list. So it is not possible.
Here is the log:
INFORMATIONAL *********** Exception occurred ************ at 12:12 PM on Aug 14, 2007
org.netbeans.api.db.explorer.DatabaseException: Nicht unterstützte Funktion
at org.netbeans.modules.db.explorer.infos.TableListNodeInfo.initChildren(TableListNodeInfo.java:75)
at org.netbeans.modules.db.explorer.infos.DatabaseNodeInfo.getChildren(DatabaseNodeInfo.java:675)
[catch] at org.netbeans.modules.db.explorer.DatabaseNodeChildren$2.run(DatabaseNodeChildren.java:94)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Caused by: java.sql.SQLException: Nicht unterstützte Funktion
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4442)
at org.netbeans.lib.ddl.adaptors.DefaultAdaptor.getDatabaseMajorVersion(DefaultAdaptor.java:3967)
at org.netbeans.modules.db.explorer.infos.TableListNodeInfo.initChildren(TableListNodeInfo.java:49)
Hi Natalie,
Thanks for sharing further details about the error you observed. Looks like this is a known issue. See here, and here.
Maybe Michael Oatley’s solution from the second link might give you an inspiration. If that still doesn’t work for you, maybe you can email Jim Davidson, he appears to be very active on nbusers alias and he responded to this exact question earlier. His email is on the first link above. If he doesn’t respond to you in a reasonable time, try nbusers@netbeans.org.
Hope this helps! And if you make any progress, please let me know. Thanks.
Hi Dave,
thanks a lot! I have the solution. It was the second link, that helped me: http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=89155. The fist mail of Michael Oatley.
You welcome.
En Oracle 10, en lugar del class12.zip, es el ojdbc14.jar, que se encuentra en:
C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib
para más información:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
Hi Jonpagecr,
Thanks for the information.
hi i m sumati .name of mi data base is election.i want to modify the content of mi data base file i.e Election-details through jsp file .cn u help me by sending coding for the jsp file .i m working on struts and mi IDE is my ecllipse
thankyou
Hi sumati,
There are tutorials on JPA/Hibernate or other persistence frameworks that will do what you want. If you really want, you can also use JDBC. Here is a tutorial that might match what you are asking for.
Hope this helps.
Brilliant, didn’t know i could do this and saved me installing other stuff to try and connect.
Set up:
Netbeans 5.5 on Windows XP
to
Oracle 10g XE (10.2.0.1) on Ubuntu 7.04 Feisty Fawn
I think that Oracle version is right.
I did however have some problems with the drives on the Oracle site so i navigated to my install and found a /jdbc folder hidden away with the driver i needed. I copied the driver from my Linux box to my Windows box, added the .jar to the libraries and walla.
Thanks Dave 😀
You welcome
I can’t find the class12.zip file.
Can you find /jdbc folder under your Oracle installation directory?
TNX Dave, your post was very usefoul.
Glad you found it useful.
Please help me how to connect database with netbeans
Databaseis oracle
i tried but always an IO error occurs and also error like
oracle.jdbc driver does not exist;
Hi gaurav,
Did you specified the correct driver?
hi,
i am getting an error when i am using netbeans5.5 with oracle8i version. The error is [microsoft][odbc oracle driver]driver not capable. please let me know whats this error.
thanks in advance
Hi mounika,
You might want to use a newer version of Oracle and NetBeans. You can download the latest version for free.
Hello,
To Srinivas and dave. sine you have successfuly installed newer driver and hooked up from your NetBeans to Oracle DBs, could you please summarize detail steps or procedures, let’s know where can I download these newer driver from? (I am using 9i Database)? How to setup connection on NetBeans? Do I need to install both class12 and class14 or other stuff?
Appreciate.
John
HI John,
For Oracle 9i, see this discussion
Hope this helps.
Hi
Great Article. I am trying to connect through netbeans as a different user than the table owner. The user that I am using has select , insert, update and delete against the tables in the owner schema. Netbeans gives me a permissions error. It seems like it requires to be able to have permissions against the Oracle metadata. I granted SELECT_CATALOG_ROLE but this did not work. When I grant the DBA role it works fine, but I cannot leave this grant in place for obvious reasons. Do you know what specific grants that are required? Any help is appreciated
Hi Tyler,
When looking around a bit, I found the following statement:
“Otherwise, when prompted, type the password. The user must have global create user privileges or the insert privilege for the mysql database, such as the root user.”
So, I would expect Netbeans most likely also need the same pivilege from Oracle. Hope this helps.
hi,
i am trying to access Oracle 10g Express Edition through Netbeans IDE 6.0 followed the steps provided on this webpage to do so, but I am getting the following error:
Unable to add connection,cannot establish a connection to jdbc:oracle:thin:@localhost:5560:orcl using oracle.jdbc.driver.OracleDriver (Io exception: Got minus one from a read call)
Can u plzz help me with this…
Thanks
i have Oracle 10g and Netbeans IDE 6.0 followed the steps provided on this webpage to do so, but I am getting the following error:
Unable to add connection,cannot establish a connection to jdbc:oracle:thin:@localhost:8081:27 using oracle.jdbc.driver.OracleDriver (Io exception: Got minus one fron a read call)
Can u plzz help me with this…
Hi Pallavi and Neha,
I don’t have anything to add beyond what I shared in the blog entry. If you were able to resolve the issue, please feel free to share your note. Thanks,
Hi Dave, I came across your blog when i am looking for some information on how to connect to a oracle db using net beans. As you said , do we need to have the Oracle or oracle client to connect to a remote oracle db as i dont find class12.zip in my system. I have JDK1.6 and Netbeans6.0.. appreciate your help in this regard
Thanks
Nimmi
Hi Nimmi,
If you have access to the database server, you should be able to find the file there. If not, check with your DBA to find the file for you. You probably can find the file if you have Oracle client installed. I have not tried that option before.
Unable to add Connection ,Cannot establish aconnection to jdbc:oracle:thin:@localhost:2030:DB using Oracle.jdbc.driver.OracleDriver(IOEXPECTION :THE NETWORK ADAPTER ERRAOR COULD NOT ESTABLISH THE CONNECTION:
IM GETTING THIS ERROR WHEN I CONNECT TO ORACLE IN NETBEAN 5.5…TELL ME WHAT I WANT TO DO CORRECT MY ERROR….. PLZ
Hi Rajmohan,
Did you start Oracle database? Is the listener running? Is the listener running on port 2030? Is “DB” the value of your database’s SID?
By the way, you might want to use the latest version of NetBeans.
Hope this helps.
problems with connecting to Oracle DB in NetBeans
Hi, guys,
I have a problem when trying to connect to Oracle DB in NetBeans. I’ve downloaded the Oracle Jar files like ocrs12.jar, ojdbc14.jar, ojdbc14dms.jar, orai18n.jar, and also I have built a new driver where I’ve added those four Jar files.
The problem is when I try to use this Oracle driver with the URL ‘jdbc: oracle:thin:@//localhost:1527/sample’, I always get a error message saying ‘unable to get a connection,cannot establish a connection to jdbc: oracle:thin:@//localhost:1527/sample using oracle.jdbc.driver.OracleDriver(Io exception:The Network Adapter cannot establish the connection)’!!
Can anyone tell me what the problem is? Did I miss some Jar files or was the URL pattern incorrect? Please help, it’s urgent!!!!!!!!! Many many thanks
Hi rajmohan,
Looks like there is a space between “jdbc:” and “oracle”. Please make sure it doesn’t exist in your environment. “//localhost” also doesn’t look right to me. I would try “localhost” or “127.0.0.1”. You should also try to change “1527/sample” to “1527:sample”. Hope this helps.
how to connect the database in netbeans 5.5 for establishing connections betwen servlets and HTML wherein the backend is MS-access
Hi Shweta,
You can try to use JDBC driver for MS access. Hope this helps,
SIr ,
i having a problem, i want to create a table using User Interface (GUI) supported by netbeans where data should come from service window provided by netbeans, by making use of table properties of Jtable(ie binding data from database which is already coonected using jdbc-odbc connection and appears on service window.)
i not able to bind data into table ,which is already
connected to databse using odbc connection and also appears on service window . i have solution to do so by manually creating (by coding),but interested in doing using jtable GUI properties.
How about this.
what is this exception means? and how to correct it.
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
thanks.
Hi icc4nkk,
Looks like you didn’t load the JDBC driver. Makes sure you do copy the library file into the right lib directory, add a reference in the server’s classpath before restart the server. Hope this helps.
Hi……I am facing problem in connecting my oracle database table with net beans.. i just could not make the connection in netbeans… I am facing problem in defining the path or location of my database tables in oracle… plz anyone can help me in this regard…or give me tutorial which can show connectivity between oracle database tables and netbeans GUI..I hope you people will help me out…As I am new to boht database and java programming
..
Hi!
I’m using NetBeans 6.5 and I’m having some troubles to connect.
The steps I’ve made:
– Create the connection pool in Glassfish, nothing special, just standard parameters (Based on javax.sql.DataSource and including URL, Username and Password).
– Create the JDBC resource associated with that connection pool,let’s say jdbc/test.
Now in NetBeans I register the driver:
– New driver -> Find the ojdbc14.jar and from the options that I can choose it shows: oracle.jdbc.OracleDriver and oracle.jdbc.driver.OracleDriver.
If i choose without .driver I got the thin drivers (the ones i want) and if i chosse the one with the other one I got the OCI drivers. So I choose the first option oracle.jdbc.OracleDriver
– Then I go to my project and click New -> Entity Classes from Database and from Datasource I select jdbc/test and it shows the following error message:
Unable to find the driver oracle.jdbc.driver.OracleDriver. Please register this driver in the Databases.
I can fix it if while registering the ojdbc14.jar I select the second option (oracle.jdbc.driver.OracleDriver) but with this option I need to specity the connection to use OCI instead of the desired thin driver.
I hope you’ll understand and help me somehow
Hi, i’m trying to connect to remote database 9i and 10g through Netbeans 6.1 Database Application. Everything works fine with my local XE Database (driver url: jdbc:oracle:thin:@localhost:1521:XE, Oracle driver ojdbc6.jar), but when I switch to the Oracle 9i or to the 10g on a remote server, and when I change to in the URL of the persistence.xml file, the netbeans application will hang for several minutes without any error message. So what can I do? Thanks.
Hi KILE,
One thing I can think of is that ojdbc14.jar doesn’t support JDK 1.6/6.0 officially. If you are on 1.6/6.0, switch to 1.5/5.0 on the IDE might be an option to try. This might be a Netbeans issue considering 6.5 is still in beta.
Hi Kira,
When you switched to 10g, did you also changed the JDBC driver for 10g?
See also: Oracle 10g JDBC drivers page, Oracle 11g JDBC drivers page
tnx a lot .. i was lookin for this onlr gr8 info .. tnx dude
Very Very Use full for every One. Thanks for your efforts
Hi, Thanks alot for the info….this helps alot.
for some of the previous comments I hav the answer which worked for me.
For Netbeans 6.1 use “ojdbc14_g.jar”
not “ojdbc14.jar”
Hi Nick,
Thanks for sharing your tip.
Please help me. How I can edit, modify, retrieve database procedures and triggers using Netbeans. Database is on another m/c and configured to access from my system
I am on Netbeans6, Oracle Apps database 10.2.0.2.0. Downloaded ojdbc14.jar and created the connection successfully. Now although I can query a table in the execute window, I dont see it in the browser, and also when I tried creating a Java DB Application. This issue is not just for this table, but multiple other tables.
What I am missing?
Any help will be greatly appreciated!
Sheena
Correction: the table I mentioned is actually a synonym in the schema that the DB connection is linked to (APPS). How do I see synonyms in the browser and when I create a DB Application through the wizard?
Thanks
Sheena
Can u please give a sample complete code for connecting to a remote oracle database using netbeans ASAP.
My code has no errors but it does not show any output.
Pls reply soon
yeah… if we’re using NETBEAN 6.5 and within the JSP pages
want to connect to ORACLE…
is there any kind of … examples of it written…?
so i could analyze it faster…
😦 hiks
hi,
i am using netbeans 6.0.1 and Oracle 9i.
I have successfully connected to database through netbeans.
but after 2/3 times i m not able to log in. it shows “Connecting to database,Please wait” but nothing happens.
I tried in 2 computer but same problem encountered.
I using host string as …… @localhost:1521:[SID NAME]
this is working perfecly on one computer but in other two computers problem encountered….
all machine are stand alone.
Thanks in advance
Santosh
Hi Santhosh,
Where did the class12.jar is located?.I’m using NetBeans 6.1 and oracle 9i,I’m trying create a database connection,but I’m sure where this class12.jar is present.Is 1521 is the default port for oracle connection?
Thanks in Advance,
Priya
Hi,
Very usefull and excellent discussion.
hi,
i am able to make connection with oracle 9i on netbeans,it is showing all the tables and is allowing me to write sql commands,but for a jsp page which is making connection with oracle 9i i am getting a error message as: oracle.jdbc.driver.OracleDriver not found. i have added oracle.ojdbc14.jar file in my lib folder.
Thanx in advance!!
You might have to update the classpath environment/configuration variable for your server so it knows which file to load.
hi I’m getting I/O exception called “the Network Adapter could not Establish the connection ”
What is the Issue??????????
import java.sql.*;
class SimpleOraJava {
public static void main(String args[]) throws SQLException {
DriverManager.registerDriver(
new oracle.jdbc.driver.OracleDriver()
);
String serverName = “Ruchi”;
int port = 2030;
String user = “scott”;
String password = “tiger”;
String SID = “ruchitha”;
String URL = “jdbc:oracle:thin:@” + serverName + “:” + port + “:” + SID;
Connection conn = DriverManager.getConnection(URL, user, password);
String SQL = “SELECT CUSTNO, CUSTNAME FROM CUSTOMER”;
Statement stat = conn.createStatement();
ResultSet rs = stat.executeQuery(SQL);
while (rs.next()) {
System.out.println(
rs.getInt(1) +
“\t” +
rs.getString(2)
);
}
stat.close();
conn.close();
}
}
hi I’m getting I/O exception called “the Network Adapter could not Establish the connection ” when try to connect DB
What is the Issue??????????
Plzzzzzz Help me???????????
Hi,
Thanks bos..may god bless u dear..
Bye
want more appropriate code
Wow very nice tutorial. Im a postgresql fan! but im planning to use also oracle db express. thank’s for the info! very nice… One Act of random kindness per day can change the world… eeheheh
How do i connect MySql to NetBeans? I need the process.
good morning..
I’ve installed my oracle 9i and create the database in it and the other computer i installed net beans as an client aplication and want to connect that two comp by peer to peer.would you eplain me how to connect to oracle database server using netbeans as an aplications.
Thank you…
i found that there’re lots kind of database. For Netbeans we have My SQL, Oracle… What kind i should choose? I want to create database with Oracle, but there’s some problem happened. Can u tell me about it( video is good for me) . Thanks a lot.
here is the useful link for to connect netbeans with oracle
http://netbeans.org/kb/docs/ide/oracle-db.html
Some genuinely nice and useful information on this web site, as well I conceive the layout has got superb features.
What a great post, really like a lot, just something so was looking for, thank you very much for the info and for sharing your time writing this
I’d really like to thanks a lot for the actual work you in some recoverable format this post. I want exactly the same best work from you in the future likewise.
This is a nice site.. I will have to bookmark this one.. thanks
A very useful and helpful site with great articles for everyone and for me too. I discovered your website from a link posted on a forum. I will Come here regularly because i like your site.
I enjoy you because of Thank you for all of the every one of your effort hard work on this site.
I was suggested this web site by way of my cousin. I’m no longer positive whether or not this put up is written by him as no one else recognize such distinct approximately my trouble. You’re amazing! Thanks!
Dave.
In this current time frame, what do you currently use to view oracle databases?
Nice post, thank you!
thank you very much , your post very great . i whish you happy and lucky
thanks again !
This is a excellent blog, will you be involved in doing an interview about just how you created it? If so e-mail me!
I guess you have made many really interesting points. Not as well many ppl would actually think about it the direction you just did. I am really impressed that there is so much about this subject that has been uncovered and you made it so nicely, with so considerably class. Top-notch one, man! Very special things right here.
i am able to make connection with oracle 9i on netbeans,it is showing all the tables and is allowing me to write sql commands,but for a jsp page which is making connection with oracle 9i i am getting a error message as: oracle.jdbc.driver.OracleDriver not found. i have added oracle.ojdbc14.jar file in my lib folder.