How to Get a BLOB Field from JDBC Coding
Hi,
I have written the JDBC Code to get the field values from the Table.
There is a BLOB field in that table.
How to get the BLOB ? What is the return type we should use.
If it is Varchar then we can use rs.getString().
If it is BLOB then what is the return type?
Thanks in Advance
Blob.
You know, people like you really give me the urge to print out several hundred pages of Java API and smack them on their heads.
Similar Messages
-
How to get only custom fields from a SharePoint 2010 list?
I am working with the Client Side Object Model. In a console application I am retrieving all fields from a custom list. The problem is the Clientcontext fetches me a bunch of internal fields I do not want to be included. Also this causes some of the fields
to appear more than once.
string siteURL = "http:XYZ";
ClientContext context = new ClientContext(siteURL);
Web oWebSite = context.Web;
context.Load(oWebSite);
context.ExecuteQuery();
//Get the list by title
List produktKatalogListe = spLists.GetByTitle("Produktkatalog");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<View/>";
ListItemCollection listItems = produktKatalogListe.GetItems(camlQuery);
context.Load(produktKatalogListe);
context.Load(listItems);
context.Load(produktKatalogListe.Fields);
context.ExecuteQuery();
foreach(Field field in produktKatalogListe.Fields)
Console.WriteLine("{0} - {1} - {2} - {3} - {4}",field.Title,field.InternalName,field.Hidden,field.CanBeDeleted,field.FieldTypeKind);
Is there a way to print only custom fields? This would mean omitting fields like
internalID, GUID...
I tried the following:
if(!field.Hidden)
Console.WriteLine("{0} - {1} - {2} - {3} - {4}",field.Title,field.InternalName,field.Hidden,field.CanBeDeleted,field.FieldTypeKind);
Unfortunately this not only does not solve the issue but is also not a very good solution for the case I do want to display custom but hidden fields.
Algorithmen und Datenstrukturen in C#:
TechNet WikiThe following approach seems to solve the issue. Instead for checking if the field is not
Hidden I checked whether it is not FromBaseType.
if(!field.FromBaseType)
Console.WriteLine("{0} - {1} - {2} - {3} - {4}",field.Title,field.InternalName,field.Hidden,field.CanBeDeleted,field.FieldTypeKind);
Algorithmen und Datenstrukturen in C#:
TechNet Wiki -
How to get multiple selected fields in list
Hello all,
I am trying to get multiple selected value from a list but i dont know how to get multiple selected fields from a list though AS3.
Actually i want to pass the selected fields to php, so for that i need to get the selections and send to php.
Thankx..i want to put the selected fields of list in an array through AS3....
actually......i figured it out how to do that...........
Its simple......use
list.selectedItems[index]
and to get the number of items selected......
list.selectedItems.length
simple..... -
How can I get the "text" field from the actionEvent.getSource() ?
I have some sample code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.ArrayList;
public class JFrameTester{
public static void main( String[] args ) {
JFrame f = new JFrame("JFrame");
f.setSize( 500, 500 );
ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
buttonsArr.add( new JButton( "first" ) );
buttonsArr.add( new JButton( "second" ) );
buttonsArr.add( new JButton( "third" ) );
MyListener myListener = new MyListener();
( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
JPanel panel = new JPanel();
panel.add( buttonsArr.get( 0 ) );
panel.add( buttonsArr.get( 1 ) );
panel.add( buttonsArr.get( 2 ) );
f.getContentPane().add( BorderLayout.CENTER, panel );
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.setVisible( true );
public static class MyListener implements ActionListener{
public MyListener() {}
public void actionPerformed( ActionEvent e ) {
System.out.println( "hi!! " + e.getSource() );
// I need to know a title of the button (which was clicked)...
}The output of the code is something like this:
hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
I need this: "first" (from this part: "text=first" of the output above).
Does anyone know how can I get the "text" field from the e.getSource() ?System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
In a real-world application, no.
In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button). -
How to get 2 maximum salary from salary field?
how to get 2 maximum salary from salary field data?
like 1000
5000
8600
2000
3000
u want 8600 in ist place and 5000 in second place ?
cud u plz suggest me any query?Hi,
If already data is in internal table then
DATA : v_cnt TYPE i.
SORT ITAB BY salary DESCENDING.
LOOP AT ITAB.
v_cnt = v_cnt + 1.
IF v_cnt > 2.
EXIT.
ENDIF.
MOVE : itab-salary to ITAB1.
ENDLOOP.
if you want extract data from database table then slect the data inot internal table and do like above.
Pls. reward if useful... -
Error when reading BLOB field from Oracle usin Toplink
We experience a very annoying problem when trying to read a BLOB
field from Oracle 8.1.6.2.0 using TOPLink 3.6.3. I have attached the
exception stack trace that is reported to the console. As far as I can
judge a fault at oracle.sql.LobPlsqlUtil.plsql_length() happens first and
then at TOPLink.Private.DatabaseAccess.DatabasePlatform.convertObject().
The exception is permanently repeating that is very critical for us.
ServerSession(929808)--Connection(5625701)--SELECT LOBBODY, ID, LABEL, FK_OBJECT_ID, FK_OBJECTTYPE FROM NOTE WHERE (ID = 80020)
INTERNAL EXCEPTION STACK:
java.lang.NullPointerException
at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil.java:936)
at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil.java:102)
at oracle.jdbc.dbaccess.DBAccess.lobLength(DBAccess.java:709)
at oracle.sql.LobDBAccessImpl.length(LobDBAccessImpl.java:58)
at oracle.sql.BLOB.length(BLOB.java:71)
at TOPLink.Private.Helper.ConversionManager.convertObjectToByteArray(ConversionManager.java:309)
at TOPLink.Private.Helper.ConversionManager.convertObject(ConversionManager.java:166)
at TOPLink.Private.DatabaseAccess.DatabasePlatform.convertObject(DatabasePlatform.java:594)
at TOPLink.Public.Mappings.SerializedObjectMapping.getAttributeValue(SerializedObjectMapping.java:43)
at TOPLink.Public.Mappings.DirectToFieldMapping.valueFromRow(DirectToFieldMapping.java:490)
at TOPLink.Public.Mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:808)
at TOPLink.Private.Descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:173)
at TOPLink.Private.Descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:325)
at TOPLink.Private.Descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:373)
at TOPLink.Public.QueryFramework.ReadAllQuery.execute(ReadAllQuery.java:366)
at TOPLink.Public.QueryFramework.DatabaseQuery.execute(DatabaseQuery.java:406)
I have started the application with Oracle JDBC logging on and found that the problem may originate in a possible lack of syncronization in the pooled connection implementation:
DRVR FUNC OracleConnection.isClosed() returned false
DRVR OPER OracleConnection.close()
DRVR FUNC OracleConnection.prepareCall(sql)
DRVR DBG1 SQL: "begin ? := dbms_lob.getLength (?); end;"
DRVR FUNC DBError.throwSqlException(errNum=73, obj=null)
DRVR FUNC DBError.findMessage(errNum=73, obj=null)
DRVR FUNC DBError.throwSqlException(reason="Logical handle no longer valid",
SQLState=null, vendorCode=17073)
DRVR OPER OracleConnection.close()
so the prepareCall() is issued against an already closed connection and the
call fails.
I assume we have been using a JDBC 2.0 compliant driver. We tried out
drivers that Oracle supplies for 8.1.6, 8.1.7 versions. To be true I
couldn't find any information about the JDBC specification they conform to. Does it
mean that these drivers may not be 100%-compatible with JDBC 2.0 Spec?
How can I find out if they are 2.0 compliant?
Also I have downloaded Oracle 9.2.0.1 JDBC drivers. This seemed to work
fine until we found another incompatibility which made us return back to
8.1.7 driver:
UnitOfWork(7818028)--Connection(4434104)--INSERT INTO STATUSHISTORY (CHANGEDATE, FK_SET_STATUS_ID) VALUES ({ts '2002-10-17 16:46:54.529'}, 2)
INTERNAL EXCEPTION STACK:
java.sql.SQLException: ORA-00904: invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.jav
a:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java
:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatemen
t.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepare
dStatement.java:589)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeDirectNoSelect(
DatabaseAccessor.java:906)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeNoSelect(Databa
seAccessor.java:960)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeCall(DatabaseAc
cessor.java:819)
at TOPLink.Public.PublicInterface.UnitOfWork.executeCall(UnitOfWork.java:Hello Yury,
I believe the problem is that TopLink's ServerSession by default executes read queries concurrently on the same connection. It does this to reduce the number of required connections for the read connection pool. Normally this is a good concurrency optimization, however some JDBC drivers have issues when this is done. I had thought that with Oracle JDBC 8.1.7 this issue no longer occurred, but perhaps it is only after version 9. I believe that the errors were only with the thin JDBC driver, not the OCI, so using the OCI driver should also resolve the problem. Using RAW instead of BLOB would also work.
You can configure TopLink to resolve this problem through using exclusive read connection pooling.
Example:
serverSession.useExclusiveReadConnectionPool(int minNumerOfConnections, int maxNumerOfConnections);
This will ensure that TopLink does not to try to concurrently execute read queries on the same connection.
I'm not exactly sure what your second problem with the 9.x JDBC drivers is. From the SQL and stack trace it would seem that the driver does not like the JDBC timestamp syntax. You can have TopLink print timestamp in Oracle's native SQL format to resolve this problem.
Example:
serverSessoin.getLogin().useNativeSQL();
Make sure you configure your server session before you login, or if using the TopLink Session Manager perform the customizations through a SessionEventListener-preLogin event. -
How to get payment document number from paid column in monthly invoice
Dear experts
I use SBO japan version and i need to know how to get payment document number from paid column in monthly invoice ?
in table MIN1, only contain invoice and credit note document number, there is no payment document number
thank you for your help
Best Regards
JeiMingDear Gordon
Yeah, you are right, i can use field MIentry in RCT2
thank you
Best regards
jeiming -
Inserting Image into BLOB field from URL
Is it possible to insert an image into a BLOB field from a URL? I don't have access to the filesystem on the server and I have a page that uses PL/PDF to generate dynamic PDF files from data I pull from the database. I would like to include my companies official header with logo on the top of the PDFs I generate and need to somehow get the image which I currently have uploaded to the images section in Application Express and can access from the "Shared Components => Images" section of the Application Builder. I just want to be able to either query whatever table holds those images or copy the image I need to a blob field in one of my tables so I can use it in my PDF document.
The other alternative (which is what I first mentioned above) would be to try and perform an insert into the BLOB field in my table but the location of the image file would be like "http://www.myportal.com:7777/pls/htmldb/wwv_flow_file_mgr.get_file?p_security_group_id=1234567&p_flow_id=111&p_fname=myimage.jpg".
Is this possible? If not, what can I do?
Thanks in advance.The reason why I am asking this question in this forum is two-fold:
1. I am using Application Express (AE).
2. Since I am using AE all images that I upload to my workspace are stored in a table in a database and not as an actual file in a directory structure like in Windows etc. This being the case, I can't ever reference any of the files that I upload to my workspace in order to insert them into my BLOB field unless I know their physical location on disk (which of course does not exist b/c they are stored in the AE database somewhere). If I knew AE's database and table structure I could do a "select into ..." from whatever table stores my uploaded images and save those images to my own custom table in my BLOB field. -
How to get the Database type from weblogic Db connection
I want to use database version control in my application . that means different database type use different Sql Statement. Such as in weblogic7.0 if I create SqlServer JDBC pool then I will use some special Sqlserver sql Statement . such as some join statement. If I create Oralce JDBC pool then I have to use different Sql statement . because these two database support different Sql statement.
What my question is how to get the database type from the connection.For a normal jdbc driver you can use
Connection.getMetaData()
To get the meta data, in particular the getDatabase...() methods.
That might or might not work.
However, at the very least in the server you have access to the weblogic properties so you can parse the pool property to figure it out. -
How to get name of table from front end
Hi,
How to get name of table from front end in EBS 11i?
thanx
AshishHi
Sandeep is correct. The "Help"/"Record History" will give you the table/view name, but sometimes this particular menu function give me a "Record History is not available here." error message.
I then use the following menu functions (this will also give you additional information, like column details).
1) Open Forms
2) Click on Help/Diagnostics/Examine (*you might have to enter the APPS password at this point)
3) Change "Block" to "System"
4) Change "Field" to "Last_query"
The system will populate the "Value" field with the query that was executed in order to populate the form.
Regards
Frank -
How to pass PO customer fields from ECC to SUS ?
Hi Gurus,
We defined a customer PO field at ECC side and want to pass it to SUS and diaplay it in SUS PO, my question is, how to pass PO customer fields from ECC to SUS?
Please advise.
Thanks and best regards
jackHi jackytam ,
/people/yeusheng.teo/blog/2008/01/05/ordering-unit-vs-order-pricing-unit-in-srm-sus
you make get some pointers
regards,
Neelima -
How to get updated table values from objectlistdataproviders
how to get updated table values from objectlistdataproviders
Hi,
Here is a sample code
start-of-selection.
*Select the data you need into an internal table
loop at it_mara into wa_mara.
data that needs to be displayed in the output list
write:/ box as checkbox,
wa_mara-matnr under text-001,
wa_mara-maktx under text-002,
wa_mara-lgort under text-003.
Hide the data that needs to moved to internal table
hide:wa_mara-matnr, wa_mara-maktx, wa_mara-lgort.
endloop.
clear wa_mara.
end-of-selection.
lines = sy-linno.
at line-selection.
clear:it_matnr.
do lines times.
check sy-index > 1.
box = space.
read line sy-index field value box.
if box = 'X'.
*data selected using check box is moved to internal table
append wa_mara to it_matnr.
endif.
enddo.
Regards,
Jisha. -
How to get Accounting document number from billing document number
Hi,
How to get Accounting document number from billing document number i.e. from VBAK- VBELN.
Cheta PantHi,
VBAK is the Sale Order header table, Billing document table is VBRK.
Sales tables (VBAK,VBAP,VBRP,VBRK) do not store accounting document numbers.
You do other way around. Just go to SE16 and enter the Billing document number in field Billing document VBELN in BSEG or BSID or BSAD table and execute, you will find the accounting document number.
If you just want collect this information once then you can use table BSEG, but if you think to develope a report then use table BSID and BSAD.
Regards,
Chintan Joshi -
How to get all the values from the dropdown menu
How to get all the values from the dropdown menu
I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
How do I get number of item is selection dropdown?
How do I extract a ?name? for each value, one by one?
How do I change a selection by referring to particular index of the item in a dropdown menu?
Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
Message was edited by: testtestThe findElement method allows various attributes to be used to search. Take the following two examples for the element below:
<Select Name=ProdType ID=testProd>
</Select>
I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
If I want to search by id I could do the following:
Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
You can use the FindElement to grab links, text boxes, etc.
The next example grabs from a link on a page
Home
Set x = RSWApp.om.FindElement("Home","A","innerText")
I hope this helps clear it up. -
How to get the return values from a web page
Hi all :
how to get the return values from a web page ? I mean how pass values betwen webflow and web page ?
thank you very much
Edited by: jingying Sony on Apr 15, 2010 6:15 AM
Edited by: jingying Sony on Apr 15, 2010 6:18 AMHi,
What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
Regards,
Karri
Maybe you are looking for
-
How Can I delete all the tracks that are not in my Itunes Library?
I am runnig out of disk space and i just want to have more space. My files are located everywhere on my mac and I saw that I have a lot of songs that are in my itunes music folder and the same are in an other folder. I want to keep everything that is
-
How to mirror my iPhone on my HDTV wirelessly?
I have what seems to be a pretty simple need. Essentially I want to do a slide show using photos on my iPhone 6, displayed on my Samsung Smart HDTV. I know I can get an adapter that will allow me to run an HDMI cable between my iPhone and an HDMI
-
How can we model dynamic approval in Oracle BPM 11g, such that a task is approved by n number of participants, where n is determined at run time. Any help would be highly appreciated. Thanks,
-
I am trying to update my apple tv, but it always returns an error
i am trying to update my apple tv, but it always returns an error that says it can't be done right now, try again later. I had to change my DNS on my iphone and ipad, and those then upgraded fine, just not apple tv. Any help will be appreciated.
-
Though there are "tons" of posts about this, I cannot find one that speaks to my level; nor one that seems to really fix the web sharing "Forbidden: You don't have permission to access /~shortname/ on this server" conundrum. I'm brand new to OS 10.5.