pradeep dewda

Greenhorn
+ Follow
since Apr 12, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by pradeep dewda

Rob Prime wrote:Did you add appenders to your logger(s), either through code or through the configuration file? Because if you don't, you get this message.



I didn't understand what you are trying to explain. Please could you describe in detail?
Although below is the log4j.properties file. Is following configuration is right?

# For the general syntax of property based configuration =
files see the
# documenation of org.apache.log4j.PropertyConfigurator.
log4j.rootLogger=3Derror, stdout, file
#log4j.rootLogger=3Ddebug, stdout, file

# this one would log to file usb.log (which will be backed up to =
usb.log.1)
#log4j.rootLogger=3Ddebug, stdout, file

log4j.appender.stdout=3Dorg.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=3Dorg.apache.log4j.PatternLayout

# Pattern to output the caller's log level, thread, class name and =
message
log4j.appender.stdout.layout.ConversionPattern=3D[%5p] %c{1} - %m%n

# This one shows the method names (slows down logging, so use only, if =
necessary).
# log4j.appender.stdout.layout.ConversionPattern=3D%d [%5p] %c{1}.%M - =
%m%n

log4j.appender.file=3Dorg.apache.log4j.RollingFileAppender
log4j.appender.file.File=3Dusb.log

log4j.appender.file.MaxFileSize=3D4MB
# Keep one backup file
log4j.appender.file.MaxBackupIndex=3D1

log4j.appender.file.layout=3Dorg.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=3D[%5p] %c{1} - %m%n

# This one shows the method names (slows down logging, so use only, if =
necessary).
#log4j.appender.file.layout.ConversionPattern=3D%d [%5p] %c{1}.%M - %m%n

# disable DEBUG for some classes
#log4j.logger.com.mcreations.usb.windows.JavaxUsb=3Dwarn

Well i am developing a e-attendance application in which i have to use usb port to connect a fingerprint reader and access that device with java application.
Rob would i explain more or is it enough?
I was using javax.usb api for accessing usb port from my java applications.

I have set jsr80.jar, jsr80_ri.jar and jsr80_windows.jar, log4j.jar, log4j.properties and javax.usb.properties to the classpath...

My java class compiled properly..

class name : TestUsb

import javax.usb.*;
import javax.usb.UsbServices;

But when i tried to run the class following runtime error occured
Log4j: Warn no appenders could be found for logger (com.mcreations.usb.windows.JavaxUsb)
Log4j:Warn please initialize the log4j system properly

Please any one can help.
Before posting this topic i have done everything that i could.

I code below class to store the image in a database but not getting result..exception : NullPointerException why???

package src;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;

public class StorePhoto extends HttpServlet
{
public void init(ServletConfig s) throws ServletException
{
super.init(s);
System.out.println("Servlet Initiated");
}
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException
{
doPost(req,res);
}
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:adsn");
Statement stmt = con.createStatement();
System.out.println("connection created");
HttpSession session = req.getSession();
String url = req.getParameter("path");//here path is the parameter coming from html page...
System.out.println("URL = "+url);
System.out.println("session ID ="+session.getId());
PreparedStatement pst = con.prepareStatement("insert into image(photo) values(?)");
System.out.println("query executed");
FileInputStream fis = new FileInputStream(url);
System.out.println("FIS object created");
byte[] b = new byte[fis.available()+1];
fis.read(b);
pst.setBytes(1,b);
pst.executeUpdate();
System.out.println("query exccuted and update done");
pst.close();
con.close();
}
catch(SQLException e)
{
System.out.println("SQL exception");
e.printStackTrace();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
Ofcourse it is fine and easy to use query..
Select * from table order by cluase ASC

We get the sorted values in ResultSet.
15 years ago

Bauke Scholtz wrote:Hint: an image is in fact a binary stream.



I found it..
getBinaryStream() and setBinaryStream()
ok Bauke..I will study and if i get any doubt i'll come to you later..thanks

Jeanne Boyarsky wrote:I don't understand. Do you want run a web app on the thumb drive that communicates with the web app? (This is certainly possible.) Or get data from the thumb drive? Or something else?



OK jeanne..i clarify.

I want to use thumb drive to get the data. But if you are saying that it is possible for thumb drive that communicate with the web app than let me know it..My problem is to store data in my database which is coming from thumb drive..and than using that data in my web app..is it enough or you want more clarifications.
Is it not possible to get the data from thumb drive?
15 years ago
Can you suggest those methods by a little example..??
I never worked with images..so i don't know how to store and retrieve images to and from the database..can any one suggest..
Some body suggest me about using BLOB or storing links in the database..but how?? i tried but faild every time..
Are there any specifc APIs which i can use to connect a USB thumb scanner with java web application??

My projcet is E-attendance. I used JAVA and JSP to develop this as a web application. I have completed my applicaion but now i have to connect my application with Thumb scanner which has its own SDK(System development Kit). I am using ms access and mysql for database..
JAVARANCH can help me when every forum had there hands down?
15 years ago