Use JAVA In Oracle To Send Blob To Printer?

Sep 18, 2014

I used the PLPDF software to generate a blob in PDF format in PL/SQL. I can open it in a browser but I would rather send it directly to a printer from PL/SQL.
 
I know I can use tools like BI and Jasper but I want this particular solution to be 100% database solution.
 
I was wondering of I can use JAVA in Oracle to send the blob to a printer.

View Replies


ADVERTISEMENT

How To Print PDF In Java - Send Document To Printer Upon User Request

Apr 24, 2008

I've been googling information on how to print a pdf in java, and it seems that the java print api is used more for printing from a swing app. What I'm needing to do is send a pdf document to the printer upon user request. I would like my app to work as follows - User selects pdf to be printed- Program determines pages to be printed and deducts amount from user account- If sufficient money, program sends job to printer automatically without popping up the print screen.- If printed successfully, then program tells user it was printed. I'm able to figure out the rest of the pieces, in regards to user input and determining pages of the pdf, except I don't see how I will be able to print the pdf.

I've tried to use this code

PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob printerJob = defaultPrintService.createPrintJob();
File pdfFile = new File("c://myPdf.pdf");
SimpleDoc simpleDoc = null;
try {
simpleDoc = new SimpleDoc(pdfFile.toURL(), DocFlavor.URL.AUTOSENSE, null);

[Code] ....

But all that I get is junk characters spread across 15 or so pages, for a pdf file that simply says "Hello World". I can open the pdf file on my computer, and print it ok, but when using the above code, it just prints out junk. How I might need to format or setup the pdf so that I can print it correctly. My program could be run on any number of Linux systems, with a multitude of printer types.

View Replies View Related

Java Servlet :: Unable To Send Data From JSP To Oracle Database

Jan 31, 2013

I'm creating a web applicaion. for that i want to create a registration page. and this registration details have to be stored in the database.

I'm getting the below error while trying to send the data ...

The requested resource (/cmd/InsertRegtodb) is not available.

Here cmd is project name and InsertRegtodb is servlet name.

Actually the servlet is present is the mentioned address. but it is not connecting to it

There is one more servlet in the same folder and which is accessible from another jsp. But this servlet is not accessible even though i have used same code as it is used for the servlet which worked for me previously...

View Replies View Related

JSP :: Unable To Send Text File Content To Printer

May 8, 2014

<%@ page import="javax.print.*"%>
<%@ page import="javax.print.attribute.*"%>
<%@ page import="java.io.*"%>
<%out.println("Printing...");
String filename = "c:/20140505_3_40.txt";//this is the text file i want to send to printer
// am using tomcat 8
PrintRequestAttributeSet pras =
new HashPrintRequestAttributeSet();

[Code]...

View Replies View Related

Printing From Java Application To USB Printer

Apr 28, 2014

How can I print to a USB printer from my Java application? I've always printed to network printers using IP addresses.

View Replies View Related

Printing Textfile Through A Printer From Java

Jan 7, 2015

I want to print a text file from java by clicking on a JButton. How to use PrintJob for that?

View Replies View Related

Java 1.8 - Rendering Images To Printer / Result Is Not Good

Feb 10, 2015

I have some troubles rendering images to the printer, any resolution does not work, even 72 in PDF printer does not work, the image is crappy.

I use the following code but the result is not good. I mean the image quality is not acceptable.

img=new ImageIcon("c:\test\m.jpg").getImage();
scale=72/300d;
g.scale(scale,scale);
g.drawImage(img, 0, 0, (int) (img.getWidth(null)/scale), (int) (img.getHeight(null)/scale), null);

I've also tried :

img=new ImageIcon("c:\test\m.jpg").getImage();
AffineTransform aft=g.getTransform();
double scale=aft.getScaleX();
g.scale(scale,scale);
g.drawImage(img, 0, 0, (int) (img.getWidth(null)/scale), (int) (img.getHeight(null)/scale), null);

The result is the same even if I change the image, very poor and unacceptable!

View Replies View Related

Oracle Driver In Java App?

Jul 26, 2014

Where do I have to put the ojdbc6.jar file so that Java finally recognizes it?I'm trying to connect to a Oracle XE databse from a Java application, but

Class.forName("oracle.jdbc.OracleDriver");

Will throw a ClassNotFoundException no matter where I put the driver. Stuff like this should be extremely simple but I am about to give up for good now.

View Replies View Related

JDBC :: Java Oracle Rac Connection URL Using Scan

Dec 30, 2014

I am trying to connect to an oracle rac using jdbc thin . when i use the scan as the host, like this

String url = "jdbc:oracle:thin:@//<scan>:port/servicename;

I get error 1153, connection refused

but when i use the ip of the rac instead of the scan

String url = "jdbc:oracle:thin:@//<ip>:port/servicename;

The connection is successful
 
Is the issue at the application level? or is the problem with the server ....

View Replies View Related

OpenJDK Java Command Running Instead Of Oracle Version

Dec 1, 2014

I've Installed oracle JDK version 1.8 on a debian machine that already has openjdk 1.6.i've set the path variable in etc/login.defs and java_home variable In etc/environment. When I echo $JAVA_HOME it points to the oracle version correctly and when I run javac It uses the oracle 1.8 version. The problem is when I run the java command , It runs the openjdk 1.6 version and I'm not sure why.If I type java -version It shows the openjdk version.

View Replies View Related

How To Save Output Of Java Program In Oracle Database

Sep 30, 2014

I have written java program which can extract online data from url and i want to store it in data base in new token row in table so than i can use in my application . how could it be done using type4 drive ..

These are my code ...

import javax.swing.text.html.parser.*;
import javax.swing.text.html.*;
import javax.swing.text.*;
import java.io.*;
import java.util.StringTokenizer;
import java.net.*;
public class ParseTest extends HTMLEditorKit.ParserCallback {

[Code] ......

View Replies View Related

IE11 Keep Redirecting To Oracle Java Download Site

Feb 10, 2014

I am running a page that launches a Java Webstart app and a Java Applet. I don't have problem launching this page in Firefox, but I have to run it in IE11. The thing is IE11 keep redirecting me to oracle java download site. I have install Java RE like 3 times from IE already. What am I missing?

View Replies View Related

Application Web Java To Insert Data Into Database Oracle From XML Files

Oct 27, 2014

I want to create an application wich can handle xml files ( display xml files's data on a html page) + insert those data into an oracle database.

I'm new to that, it a project for my internship. wich API is the most appropriate for that ( Jdom or Xstream or other), wich framework i can use ( there is only 3 IHM : connexion, upload file, display data, confirmation insertion data)?

View Replies View Related

Write Java Class Inside Oracle Stored Procedure?

Jun 21, 2013

Can we write java class or code inside Oracle Stored procedure.

View Replies View Related

Java Servlet :: HTTP Status 404 Error - Program Does Not Connected To Oracle DB?

Oct 16, 2012

I am working wit netbean 7.2 ide,oracle 10g. the servlet program does not connected to the oracle db. i always recieve a

HTTP Status 404 -

type Status report

message

descriptionThe requested resource () is not available.

Oracle GlassFish Server 3.1.2.2

View Replies View Related

How To Send SMS Using Java Program

Dec 22, 2014

How to send sms to mobile using java program. I have tried lot of examples, I didn't get perfect example ?

View Replies View Related

How To Send SMS Using Java Web Application

Dec 3, 2014

I am working on a Java Web Server application.In which server needs to send message to a Mobile no?

What are the way to send message to a mobile no by Java application.

by reading online threads i found like

[URL]

which one I should use and any other approach other than these to send a message using java application?

View Replies View Related

How To Send SMS Through Java Application

Jan 16, 2014

how can I send a sms through java application?

View Replies View Related

JSP :: Retrieve A BLOB From MySQL DB

Jan 9, 2015

I need to retrieve an image from the MySQL DB and display it in my JSP. The code below retrieves and displays the image with success. But, an exception is thrown:

SEVERE: Servlet.service() for servlet [jsp] in context with path [/FileFinalText] threw exception
[java.lang.IllegalStateException: getOutputStream() has already been called for this response] with root cause
java.lang.IllegalStateException: getOutputStream() has already been called for this response

[code]...

how can I resolve the cause with the getOutputStream() and prevent this exception to occur?

View Replies View Related

String To Blob Or Clob Conversion?

May 11, 2015

how to convert string to blob or clob data type in java coding?

View Replies View Related

JSP :: Retrieve Blob Img From MySql And Display Using Servlet?

Nov 27, 2014

create table imagedb (usd varchar(255) , image blob , primary key (usd), foreign key (usd) references logindb(user) on update cascade on delete cascade)

Using JSP i am able to upload the file into the blob. But icant retrieve or display;

The HTML Tag :

<table style="margin: 0px; margin-top: 15px;">
<tr>
<td id="photo">
<img src="displayimage" />
</td>
</tr>

The Servlet

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Connection conn = null;
Statement stmt = null;
try {
conn = (Connection) DriverManager.getConnection(DB_URL, USER, PASS);
stmt = (Statement) conn.createStatement();
// constructs SQL statement
Class.forName("com.mysql.jdbc.Driver");
Scanner s = new Scanner(System.in);

[code].....

I am not getting the image.

View Replies View Related

EJB / EE :: How To Use Java Codes To Send Email With Word Attachments

Aug 9, 2014

I have a request to create a java scheduled job to send email with attachment of word document every week. any example codes I can use. This is my first time to code this request, I do not what is the standard way to do it.

View Replies View Related

Write Byte Array To BLOB Field In Database

Mar 2, 2014

I am trying to write a byte array to a blob field in my database.

Below code is not working for me because the object is actually 902 bytes, however, the database tells me that it is 11 bytes once committed.

How to write to the blob field in my database?

Java Code:

protected void addFingerprint(byte[] fingerprintBytes) {
Statement stat;
try
{
updateQuery = "UPDATE " + currentTable + " SET CLERK_FINGERPRINT_DATA_BLOB = '"

[Code] ....

View Replies View Related

JDBC :: Prepare Statement To Insert Row That Contains Blob Column?

Mar 3, 2015

When we make prepare statement to insert a row that contains Blob column. Which way is correct? And what is the difference?

     1.  Preparestatement.setBlob(parameter number, blob type object)
     2. Preparestatement.setBlob(parameter number, inputstream type object)
 
This link show the test I made : [URL] ....

View Replies View Related

Java Socket - How To Set Value Jtext Field When Client Send Message

Apr 26, 2014

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class M_serverApp extends javax.swing.JFrame implements Runnable {

[Code] ....

View Replies View Related

Java Socket - How To Update JTextField When Client Send Message

Apr 26, 2014

Server:

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class M_serverApp extends javax.swing.JFrame implements Runnable {
ServerSocket server = null;

[Code]...

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved