Can i use SQLJ in a normal java project?

I created a normal Java Project and used SQLJ in it.But when i exported the jar file,there was a error:
JAR creation failed. See details for additional information.
  class file(s) on classpath not found or not  accessible /DBTableApp/com/ezkj/demo/sqlj/Ctx.java
Can i use SQLJ in a normal java project?
If i can,what can i do?

hi
good
go through this link
http://www.service-architecture.com/application-servers/articles/when_to_use_sqlj_with_java_application_servers.html
http://www.service-architecture.com/application-servers/articles/sqlj_data_conversion.html
Payroll Cluster table "top Important" Urgent
http://www.javaolympus.com/J2SE/Database/SQLJ/SQLJ.jsp
thanks
mrutyun

Similar Messages

  • How can I use XStream to persist complicated Java Object  to XML & backward

    Dear Sir:
    I met a problem as demo in my code below when i use XTream to persist my Java Object;
    How can I use XStream to persist complicated Java Object to XML & backward??
    See
    [1] main code
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import com.thoughtworks.xstream.XStream;
    import com.thoughtworks.xstream.io.xml.DomDriver;
    public class PhoneList {
         ArrayList<PhoneNumber> phones;
         ArrayList<Person> person;
         private PhoneList myphonelist ;
         private LocationTest location;
         private PhoneList(String name) {
         phones = new ArrayList<PhoneNumber>();
         person = new ArrayList<Person>();
         public ArrayList<PhoneNumber> getphones() {
              return phones;
         public ArrayList<Person> getperson() {
              return person;
         public void addPhoneNumber(PhoneNumber b1) {
              this.phones.add(b1);
         public void removePhoneNumber(PhoneNumber b1) {
              this.phones.remove(b1);
         public void addPerson(Person p1) {
              this.person.add(p1);
         public void removePerson(Person p1) {
              this.person.remove(p1);
         public void BuildList(){
              location = new LocationTest();
              XStream xstream = new XStream();
              myphonelist = new PhoneList("PhoneList");
              Person joe = new Person("Joe, Wallace");
              joe.setPhone(new PhoneNumber(123, "1234-456"));
              joe.setFax(new PhoneNumber(123, "9999-999"));
              Person geo= new Person("George Nixson");
              geo.setPhone(new PhoneNumber(925, "228-9999"));
              geo.getPhone().setLocationTest(location);          
              myphonelist.addPerson(joe);
              myphonelist.addPerson(geo);
         public PhoneList(){
              XStream xstream = new XStream();
              BuildList();
              saveStringToFile("C:\\temp\\test\\PhoneList.xml",convertToXML(myphonelist));
         public void saveStringToFile(String fileName, String saveString) {
              BufferedWriter bw = null;
              try {
                   bw = new BufferedWriter(
                             new FileWriter(fileName));
                   try {
                        bw.write(saveString);
                   finally {
                        bw.close();
              catch (IOException ex) {
                   ex.printStackTrace();
              //return saved;
         public String getStringFromFile(String fileName) {
              BufferedReader br = null;
              StringBuilder sb = new StringBuilder();
              try {
                   br = new BufferedReader(
                             new FileReader(fileName));
                   try {
                        String s;
                        while ((s = br.readLine()) != null) {
                             // add linefeed (\n) back since stripped by readline()
                             sb.append(s + "\n");
                   finally {
                        br.close();
              catch (Exception ex) {
                   ex.printStackTrace();
              return sb.toString();
         public  String convertToXML(PhoneList phonelist) {
              XStream xstream = new  XStream(new DomDriver());
              xstream.setMode(xstream.ID_REFERENCES) ;
              return xstream.toXML(phonelist);
         public static void main(String[] args) {
              new PhoneList();
    }[2].
    import java.io.Serializable;
    import javax.swing.JFrame;
    public class PhoneNumber implements Serializable{
           private      String      phone;
           private      String      fax;
           private      int      code;
           private      String      number;
           private      String      address;
           private      String      school;
           private      LocationTest      location;
           public PhoneNumber(int i, String str) {
                setCode(i);
                setNumber(str);
                address = "4256, Washington DC, USA";
                school = "Washington State University";
         public Object getPerson() {
              return null;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setCode(int code) {
              this.code = code;
         public int getCode() {
              return code;
         public void setNumber(String number) {
              this.number = number;
         public String getNumber() {
              return number;
         public void setLocationTest(LocationTest bd) {
              this.location = bd;
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(location);
            f.getContentPane().add(location.getControls(), "Last");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
         public LocationTest getLocationTest() {
              return location;
         }[3].
    package test.temp;
    import java.io.Serializable;
    public class Person implements Serializable{
         private String           fullname;
           @SuppressWarnings("unused")
         private PhoneNumber      phone;
           @SuppressWarnings("unused")
         private PhoneNumber      fax;
         public Person(){
         public Person(String fname){
                fullname=fname;           
         public void setPhone(PhoneNumber phoneNumber) {
              phone = phoneNumber;
         public void setFax(PhoneNumber phoneNumber) {
              fax = phoneNumber;
         public PhoneNumber getPhone() {
              return phone ;
         public PhoneNumber getFax() {
              return fax;
        public String getName() {
            return fullname ;
        public void setName(String name) {
            this.fullname      = name;
        public String toString() {
            return getName();
    }[4]. LocationTest.java
    package test.temp;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class LocationTest extends JPanel implements ChangeListener
        Ellipse2D.Double ball;
        Line2D.Double    line;
        JSlider          translate;
        double           lastTheta = 0;
        public void stateChanged(ChangeEvent e)
            JSlider slider = (JSlider)e.getSource();
            String name = slider.getName();
            int value = slider.getValue();
            if(name.equals("rotation"))
                tilt(Math.toRadians(value));
            else if(name.equals("translate"))
                moveBall(value);
            repaint();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(ball == null)
                initGeom();
            g2.setPaint(Color.green.darker());
            g2.draw(line);
            g2.setPaint(Color.red);
            g2.fill(ball);
        private void initGeom()
            int w = getWidth();
            int h = getHeight();
            int DIA = 30;
            int padFromEnd = 5;
            line = new Line2D.Double(w/4, h*15/16, w*3/4, h*15/16);
            double x = line.x2 - padFromEnd - DIA;
            double y = line.y2 - DIA;
            ball = new Ellipse2D.Double(x, y, DIA, DIA);
            // update translate slider values
            int max = (int)line.getP1().distance(line.getP2());
            translate.setMaximum(max);
            translate.setValue(max-padFromEnd);
        private void tilt(double theta)
            // rotate line from left end
            Point2D pivot = line.getP1();
            double lineLength = pivot.distance(line.getP2());
            Point2D.Double p2 = new Point2D.Double();
            p2.x = pivot.getX() + lineLength*Math.cos(theta);
            p2.y = pivot.getY() + lineLength*Math.sin(theta);
            line.setLine(pivot, p2);
            // find angle from pivot to ball center relative to line
            // ie, ball center -> pivot -> line end
            double cx = ball.getCenterX();
            double cy = ball.getCenterY();
            double pivotToCenter = pivot.distance(cx, cy);
            // angle of ball to horizon
            double dy = cy - pivot.getY();
            double dx = cx - pivot.getX();
            // relative angle phi = ball_to_horizon - last line_to_horizon
            double phi = Math.atan2(dy, dx) - lastTheta;
            // rotate ball from pivot
            double x = pivot.getX() + pivotToCenter*Math.cos(theta+phi);
            double y = pivot.getY() + pivotToCenter*Math.sin(theta+phi);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
            lastTheta = theta;  // save theta for next time
        private void moveBall(int distance)
            Point2D pivot = line.getP1();
            // ball touches line at distance from pivot
            double contactX = pivot.getX() + distance*Math.cos(lastTheta);
            double contactY = pivot.getY() + distance*Math.sin(lastTheta);
            // find new center location of ball
            // angle lambda = lastTheta - 90 degrees (anti-clockwise)
            double lambda = lastTheta - Math.PI/2;
            double x = contactX + (ball.width/2)*Math.cos(lambda);
            double y = contactY + (ball.height/2)*Math.sin(lambda);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
        JPanel getControls()
            JSlider rotate = getSlider("rotation angle", "rotation", -90, 0, 0, 5, 15);
            translate = getSlider("distance from end",  "translate", 0, 100, 100,25, 50);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(rotate);
            panel.add(translate);
            return panel;
        private JSlider getSlider(String title, String name, int min, int max,
                                  int value, int minorSpace, int majorSpace)
            JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
            slider.setBorder(BorderFactory.createTitledBorder(title));
            slider.setName(name);
            slider.setPaintTicks(true);
            slider.setMinorTickSpacing(minorSpace);
            slider.setMajorTickSpacing(majorSpace);
            slider.setPaintLabels(true);
            slider.addChangeListener(this);
            return slider;
    }OK, My questions are:
    [1]. what I generated XML by XSTream is very complicated, especially for object LocationTest, Can we make it as simple as others such as Person object??
    [2]. after I run it, LocationTest will popup and a red ball in a panel will dsiplay, after I change red ball's position, I hope to persist it to xml, then when I read it back, I hope to get same picture, ie, red ball stiil in old position, How to do that??
    Thanks a lot!!

    Positive feedback? Then please take this in a positive way: if you want to work on persisting Java objects into XML, then GUI programming is irrelevant to that goal. The 1,000 lines of code you posted there appeared to me to have a whole lot of GUI code in it. You should produce a smaller (much smaller) example of what you want to do. Calling the working code from your GUI program should come later.

  • HT201335 can i use airdrop on a normal samsung hdtv

    can i use airdro pusing a normal samsung hdtv tv

    You should be using AirPlay+Apple TV instead of AirDrop to connect to Samsung TV.

  • Can I use SQLJ instead of JSP ?

    Hi:
    Can I use SQLJ instead of JSP to work with Oracle Mobile / Wireless ?
    Thanks

    You can use any language that can output XML - There is a Tag Glossary for the Oracle9iAS Wireless XML on http://studio.oraclemobile.com .
    Regards,
    Kalle
    [email protected]
    Hi:
    Can I use SQLJ instead of JSP to work with Oracle Mobile / Wireless ?
    Thanks

  • Can  i use SLE4428 smart card with java card developmentkit 2.1.2

    Can i use SLE4428 smart card with java card developmentkit 2.1.2
    plz reply

    No. SLE4428 is memory card and not Java Card.

  • Can you use a debugger on a Java applet?

    I have a java applet .jar file. I'm running it through firefox. Can I use a debugger on this? if so, how?
    thanks.

    I'm assuming from the lack of response that the answer to my question is "no"?
    I have another program (findbugs from sourceforge) that wants debugging symbols. Should I need to do anything other than click the "generate debugging symbols" check box to make it compile with -g or whatever the normal option is to leave in debugging information?

  • How can I use LogOutComponent programatically in a Java iView?

    Hi,
    Can someone point me to the jar file(s) that I need to reference in my portal application project (Java PDK) to use LogOutComponent? Which ones do I need and where can I get them
    I got the class file 'com.sap.portal.navigation.masthead_core.jar' from the Portal server but am not sure if this file is the only one that I need to use to incorporate LogOutComponent in my code.
    Also, can somebody tell me that how can I call this component from my AbstractPortal Component to call logout programatically? I am not using JSPs and would ideally not like to redirect the response to the URL of this component but rather use the object in my Java code. Sample code to help with this would be appreciated.
    Thank you,
    - Vik.

    Hi there,
    To log a user out of the Portal I decided to go the route of: UMFactory.getAuthenticator().logout(req, res)
    Code is below.
    Thanks for your replies,
    - Vik.
    <code>
    IAuthentication Authen = UMFactory.getAuthenticator();
    HttpServletRequest req = request.getServletRequest();
    HttpServletResponse res = request.getServletResponse(true);
    //logoff user from Portal
    Authen.logout(req, res);
    </code>

  • Can I use two webservices in one Java Bean?

    Hi,
    I have created two webservices (deployed on my local J2EE Engine). I want to use both services in one application and create a new webservice that combines the functionality of both services.
    Is this possible to combine the two services with a java bean? If yes, have I to do something special?
    Is this possible at all?
    Is there another way to do it?
    Thank you!
    Bye
    Julia

    Hi Julia,
    Yes, you can call to different web services from another service.
    For that, do one thing.
    Make deployable proxies for both Web services. Then use these both deployable proxies in your main web service from where you want to call these web services.
    Code for calling these both web services is same as you are calling web services from any other J2ee or Java project.
    Regards,
    Bhavik Devisha

  • Can i use it as a normal hard drive?

    I have a pc and I wanted to know that if I could use it as a normal external hard drive?

    O-S wrote:
    I have a pc and I wanted to know that if I could use it as a normal external hard drive?
    No, the Mac's ability to start in target disk mode is not available in a PC. So that gets rid of that one.. !
    But there is a big difference between external drive and network drive.
    You can connect to the PC as a network drive.. and use shared resources..
    Just google network sharing Mac PC. In quick terms.. share a directory on the PC.. figure out permissions.. ie everyone access or if it has to be username and password figure out a common network credentials.. is easier than figuring out logins every time.
    In finder use go, go to server, and type in SMB://PCname or PCIPaddress if it is static.
    Now you can copy files to and from the directory.
    You cannot use it for TM.. as that requires HFS+ format and time machine extensions for AFP being available.
    USB or firewire external drives are so cheap.. other than sharing for backup just buy a drive.

  • How can i use contactless access cards in java

    hello everybody,
    I just want to know that can I use the contact less access cards in java. Plz tell me
    thank you

    It isn't a simple component.It is a windows service.I think a bridge only can solve the problem like .dll .olb and so on.
    Please don't think the com and dcom.I just want to know how can I call the interface of a windows service in java.
    Please help me .
    and please tell me more detail.
    Thanks.

  • Can only use Stratus in a non-commerical project?

    I wanted to make a game which eventually I would make commerical (ads, sponsorship, micro-transactions, selling, etc).  But after reading this article it seems I can't use it for commerical use...  Is this true, or perhaps did I read it wrong?  I mean in the description for Stratus I does say to make multiplayer games and I would like to make one and make money at the same time...

    hi
    good
    go through this link
    http://www.service-architecture.com/application-servers/articles/when_to_use_sqlj_with_java_application_servers.html
    http://www.service-architecture.com/application-servers/articles/sqlj_data_conversion.html
    Payroll Cluster table "top Important" Urgent
    http://www.javaolympus.com/J2SE/Database/SQLJ/SQLJ.jsp
    thanks
    mrutyun

  • How can i use a breakpoint on the first project ?

    This is a screenshot of my solution with two projects.
    But the breakpoint will work only on the second one the TestScreenshot but i want to be also to use a breakpoint/s on the Capture project. Tried to make that the Capture will be scope Scope to This but it didn't change anything.

    It's not in a release mode.
    The first project the upper one the Capture is set to class library and Active (debug)  Active (Any cpu) Any cpu
    The second project the TestScreenshot is windows application Active (debug)  Active (Any cpu) Any cpu
    I can use a breakpoint/s on the TestScreenshot but can't use breakpoint/s on the class library project.

  • How to use BO SDK in local java project?

    Hi,
    I am trying to connect BO system using below mentioned code
    public void main(String args[]) throws SDKException {
         try
              System.out.println("main");
              /ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();/
              IEnterpriseSession boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( "Administrator","","BOSAP","secEnterprise");
              IInfoStore boInfoStore =(IInfoStore) boEnterpriseSession.getService("InfoStore");
              ChangePWD(boEnterpriseSession, boInfoStore);
         }catch(Exception e)
              System.out.println("Exceptions in main");
              System.out.println(e);
    This code was taken from below mentioned thread:
    Force all users to change their Enterprise passwords with a batch operation
    I have created standalone java project and running as JAVA application in eclipce. I am getting class def not found error for these BO SDK jar files. I have added
    cecore.jar
    celib.jar and
    cesession.jar files as external lib to java project
    I am using following imports
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.plugin.desktop.user.IUser;
    Does any one know solution to fix class def not found error?
    Thanks
    Nitesh Shelar

    I did some mistake few dependent jars were missing in project build path. After adding those missing BO jar files. Now its giving server connection error. Which I am trying to resolve.
    Thanks for your help.
    Nitesh Shelar

  • Can I use my networking as normal without ConfigFree?

    Hi all...
    Recently, my configFREE on L20 has a problem. Once I click the configFREE, it says error. So I uninstalled and went to the driver to install the configFREE. Unfortunately it failed. I'm sick and tired to go back to the service center to help me.
    So if I don't install configFREE, am I able to use the networking connection as normal?

    Of course you can. The ConfigFree is tool for network monitoring and not for network configuration. It is also a kind of network diagnostic tool that helps to find out why the WLAN or LAN connection can not be established.
    In my opinion it is very nice and useful toll and you should have it on your system.

  • How Can One use XML data into our Java Program

    I have an Java Program and an XML file contaning data. I want to parse the xml data and use into my Java Program. How can I do so.

    Check out the org.xml.sax.XMLReader class.

Maybe you are looking for

  • Code for uploading a file to server from client

    please help me as soon as possible

  • Cannot install ZfD65 SP2

    Scenario: NW 6.5 SP5 ZfD 6.5 SP2 Issue: I have a server running ZfD imaging and wks import/removal. This server runs ZfD 6.5 SP2. Now I also need to install Inventory services from my product CD. But installing ZfD Inventory services from the product

  • HT3964 MacBook won't re-start

    I attempted to reset the SMC on my Macbook as instructed, and now it won't turn on.  Any suggestions?

  • Jquery cycle stacked

    The images are stacked and not cycling. Do I have to be hosted to see the cycle? below is source, css, two java files.  Help <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ht

  • Bug: RAW+JPEG Pairs import setting affects movie imports

    Hi, I want to exclude JPEG duplicates during import, but if I set RAW+JPEG Pairs to "RAW files only", then movie files are not imported. The only way I can get movie files imported is to import both RAW and JPEG. Is there a workaround for this bug?