cancel
Showing results for 
Search instead for 
Did you mean: 

groovy blob read

naveenshetty
New Contributor

groovy blob read

hi,

 

Can you please help me here ,

In the oracle database one of the cloumn "Token" stored as BLOB I want to read this and update meta data and store back to database.

could you please help me on this?

 

So far I tried with 

 

import groovy.sql.Sql
import java.sql.*

sql = Sql.newInstance("jdbc:oracle:thin:@servername.muc:port:sid", "username", "pw")
//selct blob
java.sql.Blob blob = sql.firstRow("SELECT TOKEN FROM oauth_access_token").blob
byte[] bdata = blob.getBytes(1, (int) blob.length());
String text = new String(bdata);
log.info text;

 

saved this code as .groovy and ran it in my local machine , getting 

Caught: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1541:tb2vrdeu
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1541:tb2vrdeu
at script.run(script.groovy:4)

 

 

4 REPLIES 4
nmrao
Community Hero

Re: groovy blob read

  1. Make sure the oracle jdbc driver library under READYAPI_HOME/bin/ext directory. and restart the tool.
  2. Register driver. before using it, you can find online same.


Regards,
Rao.
richie
Community Hero

Re: groovy blob read

hi @naveenshetty 

 

just an addendum to what Rao has already said.

 

make sure the jdbc.jar driver file corresponds to the version of Java you have installed

make sure the bit type (dont know the proper word for it) of the Java is the same as your ReadyAPI! installation - i.e. either x86 or 64bit.  If Java is running 32bit and ReadyAPI! is 64bit - your db connection wont work

 

cheers,

 

rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
nmrao
Community Hero

Re: groovy blob read

sonya_m
Community Manager

Re: groovy blob read

richienmrao thank you for the great suggestions on this! 

 

@naveenshetty did the advice help you solve your issue? 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors