Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL java oracle connection problem

Have Programming Question? Ask it here!
 
 
 


Manaseej
java oracle connection problem
1 Answer(s)      4 years and a month ago
Posted in : SQL


I have successfully made connection with the oracle10g database that i am using and also able to put in data using JSP. But the codes that i have tried for fetching the data are not working even though they do not show any error.Can you kindly provide me a code written in JSP for fetching data from a oracle10g database.

Advertisement
View Answers

June 19, 2010 at 12:07 PM


Hi Friend,

We have used MySQL database,try the following code:

<%@page import="java.sql.*"%>

<table border=1>

<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root","root";);
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from data");
%>
<tr><th>Name</th><th>Address</th></tr>
<%
while(rs.next()){
%>
<tr><td><%=rs.getString("name")%></td><td><%=rs.getString("address")%></td></tr>
<%
}
rs.close();
st.close();
con.close();
}
catch(Exception e){}
%>
</table>

Hope that it will be helpful for you.
Thanks


Related Tutorials/Questions & Answers:
java oracle connection problem - SQL
java oracle connection problem  I have successfully made connection with the oracle10g database that i am using and also able to put in data using JSP. But the codes that i have tried for fetching the data are not working even
Java Connection to Oracle database
Java Connection to Oracle database  HI I am ubable to connnect jdbc to Oracle database.i had gone to control panel >>Administrative tool>>>Data source,in that forDNS name i typed Oracle and in TNS i culdn't
Advertisements
About connection database oracle to java
About connection database oracle to java  Hi I culdn't connect oracle datebase to java.when i compile the program it is ok.but when i clicked... Oracle and then i clicked add button.Then Dialog box came indicating DNS and TNS
About connection database oracle to java
About connection database oracle to java  Hi I culdn't connect oracle datebase to java.when i compile the program it is ok.but when i clicked... Oracle and then i clicked add button.Then Dialog box came indicating DNS and TNS
About connection database oracle to java
About connection database oracle to java   I culdn't connect oracle... Panel>>Administrative Tools>>Data Sources in that i selected Oracle... just typed DNS as Oracle and for TNS i clicked on the list of TNS. But it has
About connection database oracle to java
About connection database oracle to java   I culdn't connect oracle... Panel>>Administrative Tools>>Data Sources in that i selected Oracle... just typed DNS as Oracle and for TNS i clicked on the list of TNS .But it has
About connection database oracle to java
About connection database oracle to java  **Hi I culdn't connect oracle datebase to java.when i compile the program it is ok.but when i clicked... Oracle and then i clicked add button.Then Dialog box came indicating DNS and TNS
jsp connection with oracle.
jsp connection with oracle.  I want to connect with jsp to oracle,,,plz send me the codes
jsp connection with oracle.
jsp connection with oracle.  I want to connect with jsp to oracle,,,plz send me the codes
oracle problem
oracle problem  Hi I have installed oracleXE on my system and for reasons i've uninstalled them and am not able to stop oracle xe services and i could'nt reinstall it. I couldnt reinstall my os for this as it is in my office
Hibernate- Oracle connection - Hibernate
to make a connection to oracle DB from eclipse. Thanks...Hibernate- Oracle connection  In Eclipse I tried Windows -->... on databaseconnection --> New Oracle Added ojdbc14 Jar file path UID
error oracle database connection?
error oracle database connection?  hi now i am trying to connect oracle database and also insert my data into table, but it's not working.. I created... in oracle table. my table name is logininfoclient_sla. this is my coding
android connection to database oracle 10g
android connection to database oracle 10g  Hello, How i can connect my android application to my oracle 10g database
Could not establish the connection to oracle - JDBC
to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8... to use: Connection conn = DriverManager.getConnection ("jdbc:oracle:thin... oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection("jdbc:oracle
Problem with url in oracle
Problem with url in oracle  hi i m having trouble with the following code. when i run it i get the error as invalid oracle url specified. i am using tomcat 6 and oracle 10g release2 10.2.0.3. heres the code <html> <
connection of java file to excel file and put data from excel file into oracle db
connection of java file to excel file and put data from excel file into oracle db  how to create button on excel sheet using java swing and how we give action to that button excel sheet? how we connect excel file to java file
oracle connectivity problem with netbeans
oracle connectivity problem with netbeans  sir I am using oracle window version +net bean6.8. jam trying to connect net bean to oracle. for this after adding new driver(ojdbc6.jar) in services tab I got connectivity with oracle
JDBC Connection code to connect servlet with oracle.
JDBC Connection code to connect servlet with oracle.  JDBC Connection code to connect servlet with oracle
REQ for connection b/w jdbc and oracle database
REQ for connection b/w jdbc and oracle database    REQ for connection b/w jdbc and oracle database    The Java classes to connect...:*** a) If you are using oracle oci driver,you have to use: Connection conn
Problem with open connection - Hibernate
Problem with open connection  Hi Team, I am running one hibernate application and the database is ORACLE 10g.I am getting the below error.I... open connection
Oracle 9i database problem
Oracle 9i database problem  Hi Somebody has given the solution but i.............,send reply immediately. I have a problem in Oracle9i .I have installed Oracle 9i in my laptop.and i got sql+ page ok.i have gone to control panel->odbc
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle
Todd oracle DB connection through PHP
Todd oracle DB connection through PHP  Can u please explain how to connect Todd oracle DB using PHP & What are the setups we need to perform? Thanks
how to solve this problem for oracle connectivity
how to solve this problem for oracle connectivity  Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap ter could not establish the connection
problem in jdbc connection
problem in jdbc connection  when i am trying to insert into apache derby databse using java in netbeans an exceprion is thrown at run time like this:- java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver....what
java-oracle
java-oracle  hi friends, I wanted to upload a image from jsp page to oracle database.i am not getting how to do it... Please help me if you can....... please give me detail code
how to solve an internet connection problem
how to solve an internet connection problem  when i run my application it give me this error: Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not yet implemented the problem is that i don`t know
if my database(oracle) connection failure means wat is the code to write in exception ?
if my database(oracle) connection failure means wat is the code to write in exception ?  if my database(oracle) connection failure means wat is the code to write in exception
Oracle - Java Beginners
Oracle   Hi sir, I installed oracle but the error occur on The java Runtime Environment was not found, at bin\jrew.exe. Hence the Oracle Universal Installer can not be run JRE version 1.1.7 Are the Java and Oracle related
how to connection jsp to oracle database connections in netbeans ide
how to connection jsp to oracle database connections in netbeans ide  how to connect jsp to oracle database connections in netbeans ide?pls provide screenshots if possible
how to connection jsp to oracle database connections in netbeans ide
how to connection jsp to oracle database connections in netbeans ide  how to connect jsp to oracle database connections in netbeans ide?pls provide screenshots if possible
JAVA BEAN WITH ORACLE FORMS
JAVA BEAN WITH ORACLE FORMS  Hi..I am doing my final year Project.. I need the ste-by-step procedure to integrate a bean with oracle forms? Please help me
how to write a code for oracle database connection in asp.net for validation.
how to write a code for oracle database connection in asp.net for validation...:\oracle\product\10.2.0\client_1\BIN directory. This directory may be different based on your oracle configuration. using Oracle.DataAccess.Client; // C
java to oracle code - JDBC
java to oracle code  please suggest m calculate the database performance between scaled images and unscaled images in the database
ex. connect to Oracle - Java Beginners
ex. connect to Oracle  dear sir, I want to ask how to connect java to oracle, please give me a details tutorial with example code how to connect to oracle. what software i must to use? thank's   Hi
java connecting to oracle db
java connecting to oracle db  PLZ SAY ME HOW TO INSERT THE VALUES INTO ORACLE THIS IS THE CODE: import java.io.*; import java.sql.*; import..."); Connection con=DriverManager.getConnection("jdbc:oracle:thin
java connection leak
java connection leak  How to check the connection leak in Java
java and oracle - JSP-Servlet
java and oracle  I am developing a small project where I need to upload the resume of the employee and store it into database and retrieve the same... data types in oracle database. And I need to write the code in servlets
Java vs Oracle Connectivity - JDBC
Java vs Oracle Connectivity  Write a java program to establish connection with oracle database?  Hi Friend, Use Oracle with Java... are using oracle oci driver,you have to use: Connection conn
java connecting to oracle db - JDBC
java connecting to oracle db  how to connect oracle data base... to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8... have to use: Connection conn = DriverManager.getConnection ("jdbc:oracle:thin
connection with MySQL to java.
connection with MySQL to java.   how to connect MySQL database with jsp
JAVA DATABASE CONNECTION WITH JTABLE
JAVA DATABASE CONNECTION WITH JTABLE  HOw To Load Database Contents From Access Database to JTable without using Vector
Java Jdbc connection
Java Jdbc connection  What are the steps involved for making a connection with a database or how do you connect to a database
Java jdbc connection
Java jdbc connection  Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
java database connection
java database connection  package com.tsi.constants; public class Constant { public static final String DRIVER = "oracle.jdbc.driver.OracleDriver"; public static final String DBURL = "jdbc:oracle:thin
java database connection
java database connection  package com.tsi.constants; public class Constant { public static final String DRIVER = "oracle.jdbc.driver.OracleDriver"; public static final String DBURL = "jdbc:oracle:thin
Java FTP Connection
Java FTP Connection  I am learning to develop a program in Java. As a learning process I want to make a connection to the FTP server just to check if it works? How to make Java FTP Connection to FTP server hosted in my network
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database... is Weblogic 8. Which is the best approach to create a connection pool? ...{ public static void main(String[] args){ Connection con = null; String url
connection retry in java
connection retry in java  How to retry the connection automatically once it get disconnect..?   Connection connection = null; while (connection == null) { try { connection = DriverManager.getConnection(url
Advertisements
 

 

 

DMCA.com