Recuperara aplicación desarrollada con PL/SQL con HTML .
Saludos, tenemos una aplicación que en su momento fue un caso de exito, se desarrollo usando Oracle 8 y la aplicación se hizo usando la libreria HTP.P(' ') para poder ejecutar PL/SQL y HTML, actualmente contamos con la versión 11g release 2 (11.2.0.10) y el modulo de Oracle Busines Intelligence 11g, la pregunta es, con estos elemetos actuales estamos en posibilidades de poder volver a levantar la aplicación en mención. ???? Envío ejemplo de código:
Hi,
SInce the PL/SQL block is keyed in dynamically, you probably want to use the anonymous PL/SQL syntax for invoking it:
// begin ? := func (?, ?); end; -- a result is returned to a variable
CallableStatement cstmt3 =
conn.prepareCall(“begin ? := func3(?, ?); end;”);
// begin proc(?, ?); end; -- Does not return a result
CallableStatement cstmt4 =
Conn.prepareCall(“begin proc4(?, ?); end;”);
SQLJ covered in chapter 10, 11, and 12 of my book furnish a more versatile dynamic SQl or PL/SQL mechanisms.
Kuassi
- blog http://db360.blogspot.com/
- book http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html
Similar Messages
-
Calling OA page from PL/SQL or HTML
Is there any mechanism to call OA page from PL/SQL or HTML ?
The reason for asking is , in iReceivables page there is section called Content Layout and which is handled by PL/SQL package. I want to call OA page from this section.
in 1158 it was working fine but in 12i it is not working.
Thanks,Hi Srini,
Thanks for your reply...
Basically I written the following code in ARI_CONFIG package to call a OA page ... this code was working in 1158 where as in 12i it is not working.
Just want to know whether the following mechanism is supported in 12i or not ...
Begin
v_bill_to_customer_id := 0;
Select distinct bill_to_customer_id into v_bill_to_customer_id from ra_customer_trx_all where printing_pending = 'Y' and bill_to_customer_id = p_customer_id;
IF v_bill_to_customer_id > 0 then
p_output_string := p_output_string||'</ul></td>
</tr>
<tr>
<td height="8" class="OraBGAccentDark"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><ul>
<li class="OraLine">';
p_output_string := p_output_string || '<font color=blue>Click For Test Newest Invoices<input type=button value=Go OnClick=window.location.href="/OA_HTML/OA.jsp?akRegionCode=ARIACCTDETAILSPAGE&akRegionApplicationId=222&Iracctdtlgocontrol_ext=&Ircustomerid='||p_encrypted_customer_id||'&Iracctdtlstype_ext=PENDING&Iraccountstatus_ext="></font></li>';
End If;
Exception
When Others then
null;
End;
Edited by: user575383 on Jul 22, 2009 12:08 PM -
ayudenme quiero reuperarlo me dijeron que con el numero de serie lo localizaban y apple lo bloqueaba!!
Google translate:
I want my stolen ipod serial number I have tried to locate in find my iphone and it is not found: (help!
ayudenme want reuperarlo told me with the serial number was blocked localizaban and apple!
- If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
- You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
- If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
- Change the passwords for all accounts used on the iPod and report to police
- There is no way to prevent someone from restoring the iPod (it erases it) using it.
- Apple will do nothing without a court order
Reporting a lost or stolen Apple product
- iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number -
[DW-2004]Crear con HTMl, formulario Maestro-detalle
Hola a todos:
Tengo que hacer una web en HTML (no php, jsp, ...), en la que
tengo una
pagina donde tengo que poner noticias, y de hay va al detalle
de la noticia,
y lo que quisiera saber es si hay alguna forma como php, aps,
de crear un
formulario maestro detalle en HTMl, me suena de ver algo en
alguna web
noticia?251, algo asi
GraciasThis is a multi-part message in MIME format.
------=_NextPart_000_001F_01C70733.94ADE7A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Si no vas a usar una base de datos para las noticias, vas a
tener que =
"modificar" la pagina maestro (noticias.htm) cada vez que
vayas a subir =
una nueva noticia y "crear" un nuevo archivo (noticia000.htm)
para el =
detalle de la noticia.=20
Adem=E1s del tiempo, a la larga vas a consumir mucho espacio
en el =
servidor..Asi que te recomiendo que lo pienses y evalues
hacer con un =
lenguaje de servidor.
Salu2
Daniel Naranjo
Lo =DAltimo Group, C.A.=20
(58+) 416 2917532
(58+) 414 7962406
www.loultimoenlaweb.com
www.loultimoenhosting.com
"Astrow" <[email protected]> escribi=F3 en el mensaje
=
news:[email protected]...
Hola a todos:
Tengo que hacer una web en HTML (no php, jsp, ...), en la
que tengo =
una=20
pagina donde tengo que poner noticias, y de hay va al
detalle de la =
noticia,=20
y lo que quisiera saber es si hay alguna forma como php,
aps, de crear =
un=20
formulario maestro detalle en HTMl, me suena de ver algo en
alguna web =
noticia?251, algo asi
Gracias=20
------=_NextPart_000_001F_01C70733.94ADE7A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963"
name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Si no vas a
usar una base de datos =
para las=20
noticias, vas a tener que "modificar" la pagina maestro =
(noticias.htm) cada=20
vez que vayas a subir una nueva noticia y "crear" un nuevo
archivo=20
(noticia000.htm) para el detalle de la noticia.
</FONT></DIV>
<DIV><FONT face=3DVerdana
size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Adem=E1s del
tiempo, a la larga =
vas a=20
consumir mucho espacio en el servidor..</FONT><FONT
face=3DVerdana =
size=3D2>Asi que=20
te recomiendo que lo pienses y evalues hacer con un lenguaje
de=20
servidor.</FONT></DIV>
<DIV><FONT face=3DVerdana
size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana
size=3D2>Salu2</FONT></DIV>
<DIV>
<P></P>
<P><FONT face=3D"Arial, Helvetica, sans-serif"
size=3D2><STRONG>Daniel=20
Naranjo</STRONG><BR>Lo =DAltimo Group, C.A.
</FONT><BR><FONT=20
face=3D"Arial, Helvetica, sans-serif" size=3D1>(58+) 416 =
2917532<BR>(58+) 414=20
7962406<BR><A=20
href=3D"
=20
href=3D"
FONT></P></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT:
5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Astrow" <<A =
href=3D"mailto:[email protected]">[email protected]</A>>=20
escribi=F3 en el mensaje <A=20
=
href=3D"news:[email protected]">news:ejae8r$oni$1@forums=
.macromedia.com</A>...</DIV>Hola=20
a todos:<BR><BR>Tengo que hacer una web en HTML
(no php, jsp, ...), en =
la que=20
tengo una <BR>pagina donde tengo que poner noticias, y
de hay va al =
detalle de=20
la noticia, <BR>y lo que quisiera saber es si hay
alguna forma como =
php, aps,=20
de crear un <BR>formulario maestro detalle en HTMl, me
suena de ver =
algo en=20
alguna web <BR>noticia?251, algo
asi<BR><BR>Gracias=20
<BR><BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_001F_01C70733.94ADE7A0-- -
I've been struggeling with this for sometime now. And keep getting "An error occured during the execution of the database script..........The error occured between the following lines of the script "5963" and "5982"....DECLARE @currentUser
nvarchar(128)"
The scenario is that this is a server with no internet connection. So I had to go through webpicmd.exe on a laptop downloaded all the necessary file whith VSLS4NOSQL. Memorystick to server and then installed the prereqs.
The database server is set to Windows Auth. only and I am not allowed to set this to mixed mode. I had set up the application with ad authentication, then forms and now nothing just to test. I still keep getting the same ******* error.
I have also tested it in a dev environment but same message here.
The db gets created on the SQL server, but thats about it. Paul van Bladel mentioned something about running the script directly on the SQL server, but it keeps popping up with even more errors. If someome could please give me the babysteps on how to perform
an installation by importing a LS application and getting it up an running I would be very thankful (what I have found of information so far, doesn't help me much)Please somebody must have experience the same thing as me here??
Here are the steps I've been doing so far
1. I create a new website in IIS (and create a new folder for my LS webapplication under inetpub)
2. Website gets created, I then under Deploy, chose import application, browse to the zip file, and then chose next.
3.Leave everything checked under Package contains...
4. Enter conncetion string, with name of SQL Server and DBname, under credentials I set it to Use Windows Integrated Security (the other options keeps failing on me)
5. Enter the name of the databaseserver again, and same with DBName
6. Under DBUserName I enter the credentials for a user I created on the SQL Server with SQL Server authentication as I can't seem to use Windows Auth. here.
7. Enter the application path (I set it here to the folder I created under inetpub).
8. The Package starts to deploy, everything seems fine. But it comes up with a warning "Cannot connect to the database 'databasename'
9. In IIS I then go to Basic Settings and edit the Physical path to C:\inetpub\path\HTMLClient, I have also edited the hostfile.
10. I start the website and browse to it, the page loads, but with a nice fat red line saying
Request failed with status code 0 and status text ".
11. In Edit Site-->Connect as --> It is set to Application user, and the AppPool for the application is set to ApplicationPoolIdentity.
12. As for now I have set no authentication in the LS app I made, but I would when I get this to work set it to Forms Based or Windows/AD auth for users in the domain. -
Hi how to add javascripts to the HTML reports generated using SQL*plus :
SET MARKUP HTML ON SPOOL ON
If we want to modify the dynamically generated HTML page by SQL*PLUS how does one do that??
Please helpIf you create a script containing the following it should work:
set markup html on spool on
spool <your file>
run sql-commands here
spool off
set markup html off -
How to output stored PL/SQL into HTML Template?
I have a PL/SQL procedure that uses htp.p to write a <script> element. The procedure writes out my Google Analytics tracking code so I don't have to update it manually in my many templates.
How do I get this procedure to write the <script> in an HTML Template?
I currently use the following at the bottom of my HTML Templates:
<!-- Google Analytics code begins -->
<script type="text/javascript" language="javascript" src="http://domain/portal/pls/portal/schema.procedure"></script>
<!-- Google Analytics code ends -->
But this produces an error in IE (still seems to track ok, but some users get error dialogs of an error at line 2 char 7).Wow! Option 2 fixed it.
So I was calling the proc via a js call as follows:
<!-- Google Analytics code begins -->
<script type="text/javascript" language="javascript" src="http://domain.com/portal/pls/portal/schemaL.proc"></script>
<!-- Google Analytics code ends -->
and the proc output the following:
<script type="text/javascript">
var gaq = gaq || [];
gaq.push(['setAccount', 'UA-999999-9']);
gaq.push(['setCustomVar', 1,'var1','value1',1]);
gaq.push(['setCustomVar', 1,'var2','value2_COM',1]);
gaq.push(['trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
</script>
Apparently the "<script>" tags in the proc output were the problem. If only I could see the generated HTML output of a page... -
SQL Reference - HTML Format offline
Hello
I'm searching the SQL Reference 11.2. I'll download the HTML-Edition, that I can use this version without internet. I've already the PDF-Version, but I'll integrate the HTML-Edition into our Intranet.
Thanks for the support.
Best regards...
rogerDownload the zip file(~800Mb) and unzip(~1.8GB)
http://www.oracle.com/technetwork/database/enterprise-edition/documentation/database-093888.html
Edited by: krramnik on May 11, 2012 5:35 PM -
[FLCS3] MOV con vista de 360º
Hola de nuevo amigos, me han pasado para poner en una web en
flash, un video
mov. Al verlo con quicktime no es un video que le des al play
y lo ves, sino
que te mueves sobre esa vista pinchando y arrastrando con el
raton, una
vista de 360º a lestilo de las de la enacrta. Mi
pregunta es, como puedo
hacer funcionar esto en flash? si importo el video solo me
saca la primera
imagen y nada mas y no me deja girar como en el mov con
quicktime
GraciasUna de las mejores que he visto es la de la empresa sevillana
Visitas
Virtuales
http://www.vista360.com/
Salu2
`8¬}
Juan Muro
"Lucas Sevilla" <[email protected]> escribió en
el mensaje de noticias
news:[email protected]...
> Bueno antes de nada que veo que no veis la diferencia
cuando está en
> formato QTVR y cuando no.
>
> Lo que hace el QTVR con la tecnología de Apple es
que podemos ver el
> efecto de profundidad, cosa que no ocurre ni con Flash
ni con los plugins
> gratuitos.
>
> Sólo se consigue con JAVA y con QuickTime, que yo
recuerde.
>
>
> "Manolo" <[email protected]> escribió en el
mensaje
> news:[email protected]...
>> Me viene a la idea esto:
>>
http://openstudio.fr/jquery-virtual-tour/
>>
>>
>> "Lucas Sevilla" <[email protected]>
escribió en el mensaje
>> news:[email protected]...
>>> Hay otra opción, exportar con el Quick Time
Pro a formato foto.
>>>
>>> En versiones anteriores lo permitía,
sobretodo si era formato ".pan" el
>>> formato panorámico nativo trabajando desde
un MAC. En Windows sólo
>>> existe el ".mov" para nuestra desgracia.
>>>
>>>
>>> "Fco. Moreno" <[email protected]>
escribió en el mensaje
>>> news:[email protected]...
>>>> Los MOV con vistas de 360º, son
películas mov desarrolladas con Quick
>>>> Time VR y contiene interactividad interna.
No pueden convertirse a FLV
>>>> y al incorporarlas a Flash dan error. Existe
una aplicación (que NO es
>>>> gratuíta) que puede convertir vistas
Quick Time VR de alta resolución a
>>>> películas de Flash, que posteriormente
puedes importar a tu flash
>>>> principal mediante cargas por nivel o
destino (loadmovie). No conozco
>>>> los resultados ni puedo valorar la
herramienta porque sólo se que
>>>> existe, y no la he probado nunca. En la
página siguiente encontraras
>>>> más información sobre ese
software:
>>>>
http://www.qtvr2flash.com/quicktime-vr-flash.html
>>>>
>>>> Un saludo
>>>>
>>>>
>>>>
>>>>
>>>> "Blue" <[email protected]>
escribió en el mensaje
>>>> news:[email protected]...
>>>>> Hola de nuevo amigos, me han pasado para
poner en una web en flash, un
>>>>> video mov. Al verlo con quicktime no es
un video que le des al play y
>>>>> lo ves, sino que te mueves sobre esa
vista pinchando y arrastrando con
>>>>> el raton, una vista de 360º a
lestilo de las de la enacrta. Mi
>>>>> pregunta es, como puedo hacer funcionar
esto en flash? si importo el
>>>>> video solo me saca la primera imagen y
nada mas y no me deja girar
>>>>> como en el mov con quicktime
>>>>>
>>>>> Gracias
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> -
Tenia ID anterior con correo que ya no existe asi que aunque tengo nuevo ID no puedo descargar compras realizadas con anterior ID
Como se puede recuperar
GraciasTenia ID anterior con correo que ya no existe asi que aunque tengo nuevo ID no puedo descargar compras realizadas con anterior ID
Como se puede recuperar
Gracias -
¿Empresas que puedan diseñar aplicación?
Buenos días:
Trabajo para un Centro de Investigación en el que tenemos una pequeña planta piloto con un sistema de control algo anticuado ya, y sobre todo, muy cerrado, por lo que dependemos totalmente de la empresa que lo diseñó en su día para poder hacer cualquier mínima modificación. Es por ello que habíamos pensado en actualizarlo usando hardware y software de LabView para poder en un futuro ir acomodándolo por nosotros mismos según nuestras necesidades pero el problema es que debido a nuestros mínimos conocimientos en este campo necesitaríamos de alguna empresa que pudiera poner el proyecto en marcha desde el principio para, desde esa base, ir luego escalándolo nosotros según lo fuésemos requiriendo. Básicamente se trata de un sistema de monitorización y adquisición de datos (tales como temperaturas usando termopares tipo K, presiones mediante medidores de presión diferencial, caudales de aire, medidas de emisiones de gases con ayuda de analizadores digitales), y accionamiento y control de algunos componentes electromecánicos de la instalación tales como electroválvulas, tornillos dosificadores de sólidos, soplantes, etc.
¿Conocéis algunas empresas con las que pudiera ponerme en contacto para contarles el proyecto y pedirles presupuesto?
Muchas gracias de antemano y un saludo.
Solved!
Go to Solution.Hola, oryctes,
las empresas que desarrollan aplicaciones para otras con tecnología de NI se llaman Alliance Partners. La página principal de España es la siguiente:
http://spain.ni.com/alliance/
Desde ahí puedes ir a la página facilitada por el otro usuario y buscar el Alliance Partner que más te interese:
http://sine.ni.com/apps/utf8/niaa.search_display
Si haces una búsqueda por compañía, van a aparecer tres: http://sine.ni.com/apps/utf8/niaa.search_int
Sin embargo, hay alguno más. Lo mejor es que te pongas en contacto con nosotros (NI) en el teléfono 91 640 00 85 para que te facilitemos las personas de contacto de esas empresas. El acuerdo al que lleguéis y las condiciones es una cuestión privada vuestra en la que NI no toma parte.
No obstante, si lo que queréis es escalar y mantener una aplicación desarrollada por terceros, te recomiendo que os forméis vosotros. Te copio un enlace en el que se muestra los cursos que ofrecemos y el calendario de formación, aunque si sois varias personas de vuestra empresa, se puede organizar un curso on site en vuestras propias instalaciones:
http://spain.ni.com/formación
Bajo mi punto de vista y habiendo leído la información que facilitas, te recomiendo, a priori, los cursos de LabVIEW Core I (24 horas), LabVIEW Core II (16 horas) y LabVIEW Data Acquisition and Signal Conditioning (16).
Espero que esta información te resulte de utilidad.
Un saludo.
Jesús. -
Does anyone know how to create a JSP which allows the user to input data into a simple database and then allow the user to input SQL queries? I can do this in a servlet but must hard code the query. It would be great to be able to type in differnet queries to see the results.
Thanks
Michaelhai,
I am giving u a small example which allows user to enter data in the html page and the same is submitted by the Jsp page in the database.
<%@ page language="java" import="java.sql.*" %>
<html>
<body bgcolor="#FFd08d" >
<%! Connection conn;
Statement st,st1;
ResultSet rs,rs1;
int i,j;
%>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:--DSNName--","--DataBaseUserName--","--DataBasePassword--");
catch(Exception e)
%>
Error in Saving : <%=e%>
<%
try
String email_address=request.getParameter("email_address");
String query_text=request.getParameter("query_text");
PreparedStatement st=null;
String inst="insert into databasename..DataBaseTableName(email_address,query_text) values (?,?)";
st=conn.prepareStatement(inst);
st.setString(1,email_address);
st.setString(2,query_text);
st.executeUpdate();
conn.close();
%>
Your query is Submitted.<br>
Thanks.
<%
catch(SQLException e)
%>
Error in Saving : <%=e%>
<%
%>
</body>
</html>
I think this will solve ur query.
bye
sameer -
Oracle.sql.BLOB.setBytes() Error
Hi,
I'm trying to use Java to put a large array of bytes into a BLOB table column. I'm first inserting the new row with an empty_blob() and then calling select <blob_column> ... for update and getting the oracle.sql.BLOB out of the resultset. I then try to call setBytes() on this BLOB and I get the following exception:
java.sql.SQLException: Invalid argument(s) in call: putBytes()
at oracle.jdbc.driver.T4CConnection.putBytes(T4CConnection.java:2440)
at oracle.sql.BLOB.setBytes(BLOB.java:916)
I'm using Oracle XE (oracle-xe-11.2.0-1.0.x86_64.rpm), the latest ojdbc6.jar, and jboss 4.2.2 on CentOS.
A code snippet of what I'm doing:
... stmt = con.prepareStatement("select blob_column from blob_table where id=? for update"); stmt.setLong(1, Id); ResultSet rs = stmt.executeQuery(); try { if (rs.next()) { WrappedResultSet wrappedRs = (WrappedResultSet)rs; BLOB oracleBlob = ((OracleResultSet)wrappedRs.getUnderlyingResultSet()).getBLOB(1); if(oracleBlob != null) { byte[] bytes = getData(); int pos = 0; long bytesLeft = bytes.length; log.debug("Attempting to write " + bytes.length + " bytes to BLOB"); while(bytesLeft > 0) { int bytesWritten = oracleBlob.setBytes(pos, bytes, pos, MAXBUFSIZE); log.debug("Wrote " + bytesWritten + " bytes to BLOB"); bytesLeft -= bytesWritten; pos += bytesWritten; } } } } finally { rs.close(); } ...
Any help would be greatly appreciated!Welcome to the forum!
Thanks for posting the code and the DB, JDBC and app server versions. Those are what is needed to help.
>
java.sql.SQLException: Invalid argument(s) in call: putBytes()
while(bytesLeft > 0) {
int bytesWritten = oracleBlob.setBytes(pos, bytes, pos, MAXBUFSIZE);
log.debug("Wrote " + bytesWritten + " bytes to BLOB");
bytesLeft -= bytesWritten;
pos += bytesWritten;That 'Invalid argument . . .' was your clue to look at the ARGUMENT values you are passing to the method call. You could have easily done that by displaying the values to the console each time in the loop BEFORE the method call.
This is the signature of that method in the Javadocs (edited to highlight the relevant parts):
http://docs.oracle.com/javase/6/docs/api/java/sql/Blob.html#setBytes(long, byte[])
>
int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
Writing starts at position pos in the BLOB value; len bytes from the given byte array are written.
Parameters:
pos - the position in the BLOB object at which to start writing; the first position is 1
bytes - the array of bytes to be written to this BLOB object
offset - the offset into the array bytes at which to start reading the bytes to be set
len - the number of bytes to be written to the BLOB value from the array of bytes bytes
>
This is what you are passing for 'len': MAXBUFSIZE
Most likely that value is LARGER than the 'byte array' that you are using; perhaps it is even the MAX int size.
That value is invalid.
In addition each time thru the loop you increment 'pos' and use 'pos' as the 'offset' into your array. Then you once again use MAXBUFSIZE as the number of bytes to write from your array. Even if MAXBUFSIZE is less than the length of your array at some point it will likely be greater than what is left of the array.
For example, if MAXBUFSIZE is 2 and your array length is 3 the first 'put' will put the first two bytes. Then the second put will use a 'pos' of 2 and try to put 2 more bytes; except there is only one byte left.
Your code updates the entire BLOB value. Best practices are to use the stream methods for reading and writing BLOB/CLOB rather than the 'setBytes' method you are using. The main reason for this is performance: the stream methods write DIRECTLY to the database.
>
Notes:
The stream write methods described in this section write directly to the database when you write to the output stream. You do not need to run an UPDATE to write the data. However, you need to call close or flush to ensure all changes are written. CLOBs and BLOBs are transaction controlled. After writing to either, you must commit the transaction for the changes to be permanent.
>
See 'Reading and Writing BLOB and CLOB Data' in the JDBC Dev Guide
http://docs.oracle.com/cd/B19306_01/java.102/b14355/oralob.htm#i1058044
>
Example: Writing BLOB Data
Use the setBinaryOutputStream method of an oracle.sql.BLOB object to write BLOB data.
The following example reads a vector of data into a byte array, then uses the setBinaryOutputStream method to write an array of character data to a BLOB.
java.io.OutputStream outstream;
// read data into a byte array
byte[] data = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
// write the array of binary data to a BLOB
outstream = ((BLOB)my_blob).setBinaryOutputStream(1L);
outstream.write(data); -
SQL Insert and Select statements on same page
Newbie here.
Is it possible to insert data from a form to a database and then get data from the database using "select" from the same page.
I have a form that submits the authors details to an Access database but I need to get the AuthorID (which is an autonumber in the table) to show on the same page.
<%@ page language="java" contentType="text/html" import="java.sql.*" %>
<html>
<head>
<title>Confirm Details Submission</title>
</head>
</body>
<%
String title = request.getParameter("title");
String surname = request.getParameter("surname");
surname = surname.replaceAll("'", "''");
String forename = request.getParameter("forename");
forename = forename.replaceAll("'", "''");
String address = request.getParameter("address");
address = address.replaceAll("'", "''");
String address2 = request.getParameter("address2");
address2 = address2.replaceAll("'", "''");
String town = request.getParameter("town");
town = town.replaceAll("'", "''");
String postcode = request.getParameter("postcode");
String email = request.getParameter("email");
email = email.replaceAll("'", "''");
String dob = request.getParameter("dob");
String telephone = request.getParameter("telephone");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection Conn = DriverManager.getConnection("jdbc:odbc:Novbase","","");
Statement Stmt = Conn.createStatement();
String Query = ("INSERT INTO Author (Title, Surname, Forename, Address, Address2, Town, Postcode, EMail, DOB, TelNo) VALUES ('" + title + "', '" + surname + "', '" + forename + "', '" + address + "', '" + address2 + "', '" + town + "', '" + postcode + "', '" + email + "', '" + dob + "', '" + telephone +"')");
//Stmt.executeUpdate(Query) is where the records are inserted.
int SQLStatus = Stmt.executeUpdate(Query);
if(SQLStatus != 0)
%>
Thank you. Your Author ID number is ??
<%
else
%>
Error - Your details have not been submitted</font></h4>
<br>
Please click back on your browser and try again. If you experience further difficulties please go to our <a href ="help.html">help</a> pages.<br>
<%
Stmt.close(); Conn.close();
%>
</body>
</html>Hi,
You could execute queries as many times as you want using the same connection.
For ex;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection Conn = DriverManager.getConnection("jdbc:odbc:Novbase","","");
Statement Stmt = Conn.createStatement();
String Query = ("INSERT INTO Author (Title, Surname, Forename, Address, Address2, Town, Postcode, EMail, DOB, TelNo) VALUES ('" + title + "', '" + surname + "', '" + forename + "', '" + address + "', '" + address2 + "', '" + town + "', '" + postcode + "', '" + email + "', '" + dob + "', '" + telephone +"')");
//Stmt.executeUpdate(Query) is where the records are inserted.
int SQLStatus = Stmt.executeUpdate(Query);
if(SQLStatus != 0)
Query = "SELECT Forname FROM Author;";
ResultSet name = stmt.executeQuery(Query);
//Now name will have all the Forname fields in the database. You could retrieve that using the get methods.
%>
Thank you. Your Author ID number is ??
<%
else
%>
Error - Your details have not been submitted</font></h4>
<br>
Please click back on your browser and try again. If you experience further difficulties please go to our <a href ="help.html">help</a> pages.<br>
<%
Stmt.close(); Conn.close();
%>
I hope that can help you.
Rajesh -
CallableStatement does not run PL/SQL with jdbc:oracle:thin driver
I have a very simple PL/SQL function:
FUNCTION CalculateDistance
(x1 IN NUMBER, y1 IN NUMBER, x2 IN NUMBER, y2 IN NUMBER)
RETURN NUMBER
AS
distance NUMBER;
BEGIN
distance := SQRT(POWER(x1-x2,2) + POWER(y1-y2,2));
return distance;
END;
I call it with:
CallableStatement cs = null;
try {
biomassStatement = con.prepareCall("{ call MYPACKAGE.CalculateDistance(?, ?, ?, ?, ?)}");
cs.setDouble("X1", -367546.78402892);
cs.setDouble("Y1", 150712.8161204);
cs.setDouble("X2", -2155095.49289);
cs.setDouble("Y2", 774013.149084);
cs.registerOutParameter("v_Return", OracleTypes.NUMBER);
cs.execute();
The only answer I get is:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'CALCULATEDISTANCE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I tried it with different Data sources (common, pool, XA) and nothing works...
Tried using ojdbc14_g.jar to see if could get more information with no help...
HELP!!!Hi,
You are calling a FUNCTION, i.e you have one return value (And four arguments)
So according to javadocs
http://download.oracle.com/javase/6/docs/api/java/sql/CallableStatement.html
Your synbtax should be like:
{?= call <procedure-name>[(<arg1>,<arg2>, ...)]}Rigtht now, your call seems to be for a procedure having five arguments.
Regards
Peter
Maybe you are looking for
-
Unable to open a report from Java SDK
Hi, I am trying to open a report from the SDK in a java application. Here is the code : package com.metrixware.test; import com.crystaldecisions.sdk.occa.report.application.OpenReportOptions; import com.crystaldecisions.sdk.occa.report.application.Re
-
I have a charge of $5.29 on my itunes account and am confused as to what i was charged for.
-
Available Disk Space Incorrect
I hav a 500 GB internal hard drive on my Mac Book Pro running Lion. In any Finder window or "get info" on my hard drive, it says I have 465 GB available (only 34 GB actually used). In Disk Utility, it says I only have 121 GB available and 379 used. W
-
Load Balancing / Clustering Quick Start
After I have gone through the documentation of Administering the server and Clustering, I still do not know where should I start with and what settings I need to add. Is there any detailed document concerning setting up a
-
Discounts for Students or signing for longer periods (eg. 1 year).
Hello there, I am a German student, really appreciate using Spotify it is. Are there any planes or possibilities out there to get a discount as a student or for signing for longer periods - lets say about one year or so.