How to use java to store Multipolygon
I fell victim to the ORA-00939 problem of too many arguments when inserting a geometry object into the database, and found details on the forum to use java to insert it instead. The code located was:
double[] coords = new double[10000];
for(int i=0; i<coords.length; i++)
coords[i] = ....;
JGeometry mypoly = JGeometry.createLinearPolygon(coords, 2/*dimensions*/, 8256);
PreparedStatement ps = connection.prepareStatement("insert into states values(?)");
//convert JGeometry instance to DB STRUCT
STRUCT obj = JGeometry.store(mypoly, connection);
ps.setObject(1, obj);
ps.execute();
The SDO_GEOMETRY I want to insert is of SDO_GTYPE 2007 (collection of polygons) [in the example below, 2]
I can see in the sample code where to put the SRID (8307), but nowhere in the code, and nowhere in the Geometry class where I can create a multipolygon.
Anyone care to help with this?
As a secondary question: Some of the sites I'm updating have a boundary delineated by one polygon, some by more than one - can SDO_GTYPE 2007 be used for all, regardless of how many there are?
UPDATE LOC SET SITE_BOUNDARY=MDSYS.SDO_GEOMETRY(
2007,
8307,
SDO_POINT_TYPE(60.49772542, -1.452049075, NULL),
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1, 105,1003,1),
MDSYS.SDO_ORDINATE_ARRAY(50.49678550013553,-7.217321117344117, ... <trimmed, you don't want to see it all>...)
WHERE SITECODE='970A3';
This didn't work for me, but it got me close. I kept getting a null pointer exception on JGeometry.closeCoord when I used Object[]. Didn't matter if I made sure to close my rings or not. (The API docs suggest it will do this for you.)
Nonethelss, the following example does work:
double[] poly1 = {50,100, 51,101, 52,102, 53,103, 54,104};
double[] poly2 = {60,110, 61,111, 62,112, 63,113};
double[][] jpoly = {poly1, poly2};
JGeometry jgeom = JGeometry.createLinearPolygon(jpoly, 2, 8307);
The first array of doubles contains the x,y points seqentially. {x1,y1, x2,y2, x3,y3, ...}
Then you just have an array of the array of doubles. One for each polygon in the multipolygon.
Then, as luc said above, make sure you set the type correctly for multi or single polygon.
jgeom.setType( JGeometry.GTYPE_MULTIPOLYGON );
-or-
jgeom.setType( JGeometry.GTYPE_POLYGON );
I tested this using the sdoapi.jar from my Oracle 11.2.0.1 install, so I'm pretty sure I'm up to date.
Hope that helps somebody else.
-C.
Similar Messages
-
How to use java source in Oracle when select by sqlplus.
How to use java source in Oracle when select by sqlplus.
I can create java source in Oracle
import java.util.*;
import java.sql.*;
import java.util.Date;
public class TimeDate
public static void main(String[] args)
public String setDate(int i){
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new Date((long)i*1000));
System.out.println("Dateline: "
+ calendar.get(Calendar.HOUR_OF_DAY) + ":"
+ calendar.get(Calendar.MINUTE) + ":"
+ calendar.get(Calendar.SECOND) + "-"
+ calendar.get(Calendar.YEAR) + "/"
+ (calendar.get(Calendar.MONTH) + 1) + "/"
+ calendar.get(Calendar.DATE));
String n = calendar.get(Calendar.YEAR) + "/" + (calendar.get(Calendar.MONTH) + 1) + "/" + calendar.get(Calendar.DATE);
System.out.print(n);
return n;
I have table name TEST
ID DATE_IN
1 942685200
2 952448400
When I write jsp I use method setDate in class TimeDate
The result is
ID DATE_IN
1 1999/11/16
2 2003/7/25
Thanks you very much.It is unclear where you are having a problem. Is your issue at runtime (when the form runs in the browser) or when working in the Builder on the form?
Also be aware that you will need to sign your jar and include some new manifest entries. Refer to the Java 7u51 documentation and blogs that discuss the changes.
https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html -
Hi Experts,
please help me ,
How TO Use Java Mapping In XI?
Thanks
MaheshHi,
Just refer the following links for java mapping:-
1./people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs
2./people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
Regards,
Ashwin M
Reward if helpful -
JNI - how to use java access function in TypeLibrary( .tlb file) HELP ME PL
Hey All
I got one project which can be done by calling up functions in xxxx.tlb
(window type library) file, that is no problem.
How to use java to access those functions???
I know there are some classes which can be used to access function in
DLL file e.g. JAWIN.
Is the .tlb file related to one DLL file??? if so, how to locate the
DLL file through .tlb file???
Thanks a lot.
SteveUse JNI to create a link between Java class and a DLL, then you can load that DLL (or TLB) from that class.
Read the JNI Tutorials. -
How to use java integrate with ondemand
Hi All,
As i'm new to integration, can anyone help me to use java integrate with ondemand that inserts some records in ondemand and deletes some records from ondemand in secheduled interval basis.?
Thanks in advance..!
regards
sowmGreetings,
hi forum...
how to use Java WebStart with EJB ? examples ?Well, for starters these are complementing, not 'cooperating', technologies. I presume, since EJB's do not - directly, at least - communicate with a web browser, that you intend for "Java WebStart" to somehow invoke an EJB?? Java WebStart is a technology for running client-side (Java) applications from the web browser - perceptively, the application resides on the server, but technically it, like an applet, is downloaded to the client and run there. Unlike an applet, however, it is not constrained by "sandbox" restrictions and does not have to be re-downloaded each time it is invoked - though the process allows for automagically updating the client-side with new versions of the application. ;) So, with this in mind, to "use Java WebStart with EJB" means little more than deploying an EJB client application with Java WebStart as the distribution channel.
thanks
minduRegards,
Tony "Vee Schade" Cook -
How to use Java Beans In JSTL?
Hi
I want to know how to use Java bean in JSTL
please explain this with giving any one example.
Thanks-
SwapneelA bean is obtain by <jsp:useBean> tag nd once bean is obtained we can get its property by using getProperty tag.
-
How to use java script when popups are blocked in browser
How to use java script when popups are blocked in browser
Not. When people install a popup blocker they don't WANT popups, so stop trying to force them down their throats.
-
How to use java api for function activity in embed oracle workflow?
because i can't install standalone oracle workflow successfully.
pls tell me how to use java api for function activity in embed oracle workflow?
are there some patch or pulg-in package?
ths a lot...........The Java Function Activity Agent is not certified for Oracle Workflow embedded in Oracle Applications. Installing standalone workflow should be a lot easier than what you have found, although it looks like you did hit a Pentium 4 issue with the Oracle Universal Installer. I suggest you contact Oracle Support or Oracle Consulting for assistance.
because i can't install standalone oracle workflow successfully.
pls tell me how to use java api for function activity in embed oracle workflow?
are there some patch or pulg-in package?
ths a lot........... -
How to use Java code inside WebDynpro-ABAP
Hi,
How to use Java code inside WebDynpro-ABAP.
Could any one provide sample code.
Cheers,
SamHi Sam,
We can't Bring Java Inside the ABAP. Both are running in different Environments.
and also ABAP Codes are runs on BASIS.
-Basis is a middleware between ABAP codes and Ur OS.
-Contains set of programs to load,RUN,intepret the ABAP program..
So Both are Different.
Regards,
Ramganesan K. -
hi
i want to ask how to use java in form 9i, can any one plz. give me an example
thanks & best regards!
SoftDesireFrom an earlier posting:
"Have a look in the online help for "Java Importer", PJC and "Java Bean".
There are also some paper on otn.oracle.com/products/forms
Click to view the papers and you will see a couple which should how to integrate Forms and Java.
Hope this helps.
Grant Ronald
Forms Product Management"
HOpe this helps.
Grant -
How to use Java WebStart with EJB ?
hi forum...
how to use Java WebStart with EJB ? examples ?
thanks
minduGreetings,
hi forum...
how to use Java WebStart with EJB ? examples ?Well, for starters these are complementing, not 'cooperating', technologies. I presume, since EJB's do not - directly, at least - communicate with a web browser, that you intend for "Java WebStart" to somehow invoke an EJB?? Java WebStart is a technology for running client-side (Java) applications from the web browser - perceptively, the application resides on the server, but technically it, like an applet, is downloaded to the client and run there. Unlike an applet, however, it is not constrained by "sandbox" restrictions and does not have to be re-downloaded each time it is invoked - though the process allows for automagically updating the client-side with new versions of the application. ;) So, with this in mind, to "use Java WebStart with EJB" means little more than deploying an EJB client application with Java WebStart as the distribution channel.
thanks
minduRegards,
Tony "Vee Schade" Cook -
How to use Java as a Front-end app
how java application can be used as the Front-end interfaces to Forte based
applications???
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Rajiv,
If you have Forte's WebEnterprise product, and Forte version 3.0.G.x or
later, you have the ability to export an IIOP interface for any Forte
service object. In fact, you can go one step further and generate a Java
interface that "hides" the IIOP issues from the developer. The way you do
this is to do the following:
1) From the partitioning workshop, double click on the service object you
wish to expose as an IIOP interface. This will bring up the Service Object
Properties dialog.
2) Off the Export tab, set the External Type drop down to IIOP. If IIOP is
not an available option in the drop down list then you do not have
WebEnterprise install.
3) From here you need to set up the necessary IIOP configuration parameters
(see the documentation for details on the specifics of what the parameters
control).
4) If you want to have Forte generate a JavaBean interface and the necessary
Java classes to be called by your application then make sure you select the
Java parameter at the bottom of the Configuration dialog. If IDL is
selected then Forte will generate a generic IDL interface.
5) When you make your distribution Forte will generate the Java classes for
you.
This mechanism works very well for accessing a Forte service object from a
Java application.
Good Luck!
Jeff Wille
-----Original Message-----
From: Rajiv Srivastava <[email protected]>
To: [email protected] <[email protected]>
Date: Wednesday, December 09, 1998 2:03 PM
Subject: how to use Java as a Front-end app
how java application can be used as the Front-end interfaces to Forte based
applications???
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
how to use the apple store? is there any google account needed? cause in my phone gmail requires.. help please
raynee88 wrote:
how to use the apple store?
What is an Apple ID?
How do I get an Apple ID?
From here > http://support.apple.com/kb/HT5622 -
How to use java 6 and uninstall java 7 ?
Curently I'm facing some problem uninstall java 7, whenever I delete java 7 and install java 6, when i check on my java -version it is showing java version "1.7.0_09".
How can use java 1.6 instead of 1.7 ? Please help thanks.The following article should show you how:
https://service.parachat.com/knowledgebase/226/How-can-I-uninstall-Oracle-Java-7 -and-reinstall-Apples-Java-6-on-my-Mac.html
Hope this helps -
Help:how to use java.util.jar to zip or unzip a binary file.
how to use java.util.jar to zip or unzip a binary file or a file contain native code.
It may help you to know how I add JARs
1. I open my Project (myProject)
2. I Mount the JAR to the FileSystem (like mypackages.jar = which includes com.mus.de.myClass.java)
3. I Mount the File to the FileSystem (like c:\..myfiles..\myProject)
3.1 I add the File to my Project
4. I select File | New -> Classes | Main
4.1 I typed "import com.mus.de.myClass.java" to refer to this package.
4.2 I called some of the public methods
thats it
Andreas
Maybe you are looking for
-
I would like to express my disappointment in Lenovo's product and their lack of apt customer service. I bought my X1 Carbon (adaptive keyboard) in Singapore while on holiday sometime late March. I started using it mid-April. I am currently residing
-
How can I get actual table name for Bom_Bo_Pub.Bom_Revision_Tbl_Type? I am trying to confirm if this particular table has a "REVISION_LABEL" column in 11.5.9.
-
Basic aperture help? Can anyone help out!?
Iam adventuring into the art of editing photos but having trouble deciding if Aperture is for me. I tried Capture Nx2 but watermarking is a major component ill be using and it doesnt support that. I tried Gimp but it works with X11 and it doesnt seem
-
I need to convert a pdf file to its binary contents so I can send it as a message to an IBM MQ Series. How can i convert pdf to its binary contents in java? Is there other alternatives besides converting pdf to binary representation? String? Array of
-
Hi folks, I recently bought a HP Photosmart Premium C309g, set it all up, tested a few functions and then went about looking how to add apps.. OK you forum regulars know where this is going.. there's no way of adding them, then from looking on this f