English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How to display a oracle table from a java program.

Hello friends, I have written a Java program, using oracle 10g as backend.

I want to display a oracle table as output. Im not getting how to display oracle table as a output table.. Pls help me
Thank you

2006-11-20 16:49:41 · 5 answers · asked by JaYaNtH 3 in Computers & Internet Programming & Design

5 answers

Hai Shaam,
I assume that you are successful in obtaining aconnection to the
Oracle Table, If not please code as necessary like
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
Connection con=DriverManager.getConnection("jdbc:odbc:", "","");
Statement stm = con.createStatement();
ResultSet rs = stm.executeQuery();
// you will get each value by using
//rs.getString() then store it in an array
//display it to output,
//if you need to display it in an output table in java
//you can use JTable in the swing library.
}
catch(Exception e){}

for further details you can contact me

email:ananthasivanvk@gmail.com
cell:+919995403653

2006-11-24 18:17:21 · answer #1 · answered by Anand 3 · 2 0

basic n 1st most steps:
1) create a odbc datasource name for oracle using odbc datasources

2) then hope ur java code has the connectivity codes from
"
try{
class.forName(...)
.
.
.
statement st= con.createStatement();
ResultSet rs = st.executeQuery("select * from ");
while(rs.next())
{
System.out.println(rs.getString(1) + " :: " + rs.getString(2) + "::" ....upto rs.getString(n));
}
}
catch(Exception e)
{
System.out.println("Exception occured : "+e);
}

2006-11-24 06:38:18 · answer #2 · answered by personalitystar 2 · 0 0

Hi, You can use executeUpdate("insert query") to insert data into database. You have to first form the query before writing the execute update or you can give the query directly in executeUpdate statement. Ex: Statement st = conn.createStatement(); st.executeUpdate("insert into emp values (100,'Smith')");

2016-03-29 03:50:11 · answer #3 · answered by Anonymous · 0 0

http://www.samspublishing.com/articles/article.asp?p=26251&seqNum=5&rl=1

2006-11-20 17:12:08 · answer #4 · answered by Tamayi M 2 · 0 0

http://www.exzilla.net/docs/jdbc/jdbctCodetemplates.html?PHPSESSID=33e09f73d351b71f9e0fc4a3cdc42652#ExDML

2006-11-20 21:11:34 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers