Skip to Main Content

SQL & PL/SQL

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.

Request for enum support in pl/sql

User_LFNWXOct 14 2022 — edited Oct 14 2022

Request for ability to define enum like structures in pl/sql. Currently there workarounds to do this like using oracle types and constructor functions. However would like to see a more user-friendly implementation of this.

Comments

802908
Hi

concerning the parallel port i found the following link

http://www.supportnet.de/listthread/172182

concerning other connections: do you have the possibility of using a serial (RS232) communication?

friendly greetings

BB
807580
That link was not in english, but even the google-translated version was not of much help. I already know about the comm API and how it works. Unfortunately I do not have the option of using a serial port. The device that is sending the data is a Jet Direct and only has parallel output.
Melssj5
Well, the comm API has all you need.

With the comm api you can read and send through paralel port and you can also use the comm api to get and send data through USB. Sending it just to the com port in which the usb is!
802908
I just thought the link might be useful because i had the impression that the posted code was also intended for reading data from a parallel port.
Not just for writing. Am i mistaken there?!
807580
I haven't read anywhere that the comm api can be adapted for usb communication. Is this really the case?

You should be able to read data from a parallel port, but Java has problems with XP, and since it discontinued support for windows, the issue has not been fixed.
Melssj5
of course, USB is just a serial comunication. Universal Serial Bus, you just have to send the data to the specified COM port of the usb and thats all. I dont know about any problems about java and XP!
807580
The problem with XP i was talking about is only with the comm 2.0 api... see this link

Can you give me any sort of example of how i can capture USB communication via a COM port? When i list all available com ports, i dont see any "extra" for USB, so which one would i grab?
802908
Hi

i once had a device (a flowmeter for measuring the gas flow) which was connected via USB to the PC, but this USB port has also been mapped to a COM port. In this case i could control the device via COM port. But i dont know whether this is generally like that.

Other devices which i know and which are connected via USB dont have this mapping to COM. These have their own USB drivers (but these are not written in Java as far as i know).

I guess it depends on the device, but im no expert in these issues...

regards

BB
807580
Other devices which i know and which are connected via USB dont have this mapping to COM. These have their own USB drivers (but these are not written in Java as far as i know).
The USB->COM mapping happens when device implements CDC (CommunicationDeviceClass) USB class. Both Linux and XP do have built-in driver for them which maps it to COM port. As far as I know this is the easiest (and possibly - only not involving writing windows driver or installing dedicated semi-universal driver like winusb.sys ) way to talk to USB device.

For accesing COM port you will need rxtx.org gnu.io.comm java library since javax.comm api for Windows was abadoned by Sun.

The main trouble with CDC is : "how to explain user which damn com port he/she should select when connecting to you fabulous USB device".

regards,
Tomasz Sztejka
807580
Hi,

Im trying to connect 2 computers using USB or Parallell port. On one computer I want to install a printer (regular windows printer) that prints through either USB or the Parallell port. On the other computer I want to listen on the Parallell port/USB port and receive the input and write it to a file.

Does anyone have a some sample code to do this? I've tried the following code (rxtx) but it cant find more than 2 ports (one parallel and one serial - no USBs even though I have 5 USB ports). Since I could only find the USB I tried to listen on the Parallell port. Problem is that I dont receive any data.

<---THE CODE--->

Enumeration port_list = gnu.io.CommPortIdentifier.getPortIdentifiers();
while (port_list.hasMoreElements ()) {
CommPortIdentifier port_id = (CommPortIdentifier)port_list.nextElement ();

if(port_id.getPortType () == CommPortIdentifier.PORT_PARALLEL) {
System.out.println("Found port "+port_id.getName()+ "id "+port_id);
CommPort commPort = port_id.open("",2000);

InputStream is = commPort.getInputStream();

byte buffert[]=new byte[1024];
int len;
System.out.println(">>>>>>>>len "+is.read(buffert));
while((len=is.read(buffert))==-1)
{
Thread.sleep(500);
is = commPort.getInputStream();
System.out.println(">>>>>>>>len "+len);
}

}
}
807580
USB java API for Windows:

http://javausbapi.blogspot.com/
and
https://sourceforge.net/projects/javausbapiforwi/
dcminter
Locking zombie thread.
1 - 12

Post Details

Added on Oct 14 2022
4 comments
210 views