Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RMAN restore backup on same server with same name

R-MANMay 25 2017 — edited Jun 28 2019

Hello Team,

Today is 25th May '17 and I want to restore the data till 16th may only.

How I shall proceed.

Do I need to drop the database first and then I shall restore controlfile and restore/recover database or any other option is there.

My point is - Do I need to drop the database first and then restore it from backup piece of 16th may or I can go without dropping the database.

Regards,

Ronak

This post has been answered by Dude! on Jun 12 2017
Jump to Answer

Comments

Kayaman
You can create a HTTP request and pass the return value as an URL parameter (or if the page uses POST, pass it that way).
srhcan
Kayaman wrote:
You can create a HTTP request and pass the return value as an URL parameter (or if the page uses POST, pass it that way).
can you give example of this (how to create HTTP request and passing the value)? Thanks
Kayaman
You can use the HttpURLConnection class, or get an easier to use library, such as the apache HttpClient.

Tens of thousands of examples on both available on the internet.
srhcan
ok I tried a simple test and it is not working, can anyobdy tell me what I am doing wrong here?

I created a web application project JEE_Test
I created 2 jsp: First.jsp and Second.jsp
I created 1 class: Test.java

First.jsp instanstiates Test.java and calls its method redirect() which creates the HTTP request for Second.jsp.
What I want is that I will call the First.jsp as http://localhost:8080/JEE_Test/First.jsp and I will get the Second.jsp

This is my First.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@page import="com.test.Test"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>First.jsp</title>
</head>

<body>

<%
Test test = new Test();
System.out.println("First.jsp: test object created");

test.redirect();
%>

FIRST

</body>

</html>
This is my Second.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Second.jsp</title>

<script type="text/javascript">
function executeAfterLoad() {
	alert("Second.jsp: inside executeAfterLoad()");
}
</script>
</head>

<body onload="executeAfterLoad();">

SECOND

</body>

</html>
This is my Test.java:
package com.test;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;

public class Test {

	public void redirect() {
		
		HttpURLConnection connection = null;
		
		try {
			String message = URLEncoder.encode("ABC", "UTF-8");
			System.out.println("Test.java: redirect(): message=" + message);
			
			URL url = new URL("http://localhost:8080/JEE_Test/Second.jsp");
			System.out.println("Test.java: redirect(): url=" + url);
			
			connection = (HttpURLConnection) url.openConnection();
			System.out.println("Test.java: redirect(): connection=" + connection);
			
			connection.setDoOutput(true);
			System.out.println("Test.java: redirect(): after connection.setDoOutput()");
			
			connection.setRequestMethod("POST");
			System.out.println("Test.java: redirect(): after connection.setRequestMethod()");
			
			OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
			System.out.println("Test.java: redirect(): writer=" + writer);
			
			writer.write("message=" + message);
			System.out.println("Test.java: redirect(): after writer.write()");
			
			writer.flush();
			System.out.println("Test.java: redirect(): after writer.flush()");
			
			writer.close();
			System.out.println("Test.java: redirect(): after writer.close()");

			System.out.println("Test.java: redirect(): connection.getResponseCode()=" + connection.getResponseCode());
			System.out.println("Test.java: redirect(): HttpURLConnection.HTTP_OK=" + HttpURLConnection.HTTP_OK);
			
			// if there is a response code AND that response code is 200 OK, do stuff in the first if block
	        if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
	            // OK

	        // otherwise, if any other status code is returned, or no status code is returned, do stuff in the else block
	        } else {
	            // Server returned HTTP error code.
	        }
	        
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			
		} catch (MalformedURLException e) {
			e.printStackTrace();
			
		} catch (IOException e) {
			e.printStackTrace();
			
		} finally {
			
			if (connection != null)
				connection.disconnect();
		}
		
		
	}
	
}
But this is not happening; I stay at First.jsp instead of getting Second.jsp. I am getting connection.getResponseCode() as 200.

What I am doing wrong? Please help.

Edited by: srhcan on Mar 5, 2013 5:44 PM

Edited by: srhcan on Mar 5, 2013 5:44 PM

Edited by: srhcan on Mar 5, 2013 5:45 PM
r035198x
You don't need HttpURLConnection to navigate between JSPs in the same web application. Read about how to use RequestDispatcher here http://docs.oracle.com/javaee/5/tutorial/doc/bnagi.html, or better yet dump, JSP and use JSF with facelets, it already comes with a versatile navigation mechanism.
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 11 2017
Added on May 25 2017
16 comments
5,262 views