Avitek medical records tutorial-- compilation errors
I have downloaded and extracted the zip file to medrec_tutorial. when i try to run mybuild.xml i get 100 compilation errors as - cannot resolve symbol--
Can anyone tell me what is the solution to this problem. Thanks
I am getting the same errors. Please let me know if anyone has found a solution.
thanks,
-Won
Here is a sampling of some of the errors:
[wlcompile] symbol : class PatientWS
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] PatientWS patientWS = null;
[wlcompile] ^
[wlcompile] C:\medrec_tutorial\src\physicianEar\physSessionEjbs\com\bea\medrec\c
ontroller\PhysicianClientUtils.java:168: cannot resolve symbol
[wlcompile] symbol : class PatientWS
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] patientWS = new PatientWS();
[wlcompile] ^
[wlcompile] C:\medrec_tutorial\src\physicianEar\physSessionEjbs\com\bea\medrec\c
ontroller\PhysicianClientUtils.java:192: cannot resolve symbol
[wlcompile] symbol : class Prescription
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] Prescription rX = null;
[wlcompile] ^
[wlcompile] C:\medrec_tutorial\src\physicianEar\physSessionEjbs\com\bea\medrec\c
ontroller\PhysicianClientUtils.java:195: cannot resolve symbol
[wlcompile] symbol : class Prescription
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] rX = new Prescription(pRxWS.getPatientId(),
[wlcompile] ^
[wlcompile] C:\medrec_tutorial\src\physicianEar\physSessionEjbs\com\bea\medrec\c
ontroller\PhysicianClientUtils.java:217: cannot resolve symbol
[wlcompile] symbol : class PrescriptionWS
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] PrescriptionWS rXWS = null;
[wlcompile] ^
[wlcompile] C:\medrec_tutorial\src\physicianEar\physSessionEjbs\com\bea\medrec\c
ontroller\PhysicianClientUtils.java:220: cannot resolve symbol
[wlcompile] symbol : class PrescriptionWS
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] rXWS = new PrescriptionWS();
[wlcompile] ^
[wlcompile] C:\medrec_tutorial\src\physicianEar\physSessionEjbs\com\bea\medrec\c
ontroller\PhysicianClientUtils.java:262: cannot resolve symbol
[wlcompile] symbol : class PrescriptionWS
[wlcompile] location: class com.bea.medrec.controller.PhysicianClientUtils
[wlcompile] PrescriptionWS[] rxWS = null;
[wlcompile] ^
[wlcompile] 100 errors
BUILD FAILED
file:C:/medrec_tutorial/src/physicianEar/mybuild.xml:4: Compile failed; see the
compiler error output for details.
Similar Messages
-
Cannot find Avitek Medical Record
I'm looking for samples and keep pumping into references to the Avitek Medical Record application. Is there a version for WebLogic 10.3.1? Documentation in a couple of places (including version 9.2 as shown here http://download.oracle.com/docs/cd/E13222_01/wls/docs92/samples.html indicates 'Avitek Medical Records is available from the Start menu on Windows machines.' Where exactly is this? I don't see anything under Start / Programs / Oracle Weblogic.
Also, Where are the API examples? Same documentation indicates 'WebLogic Server 9.2 optionally installs API code examples in WL_HOME\samples\server\examples\src\examples, where WL_HOME is the top-level directory of your WebLogic Server installation'. I cannot find these samples either.
Edited by: disaak on Oct 23, 2009 5:23 AMOk. I understand exactly the issue and been there a month back. Basically when we install weblogic 10.3 from installer, we choose Typical option. This "Typical" option DO NOT load or install the Samples. At the time of installation choose Custom option and check the check box for SAMPLES. This installs all the samples at the location that you mentioned already.
NOW, since you have already installed weblogic, still there is no problem. If you have the installer for weblogic (or get from oracle site), run the installer. Choose the same bea home where you installed existing wls, then choose Custom mode. Install the Samples. And you should be all set.
Under Start -> Programs -> .. -> .. ->.....you should see new short cuts for start, stop samples server, Med Record server etc etc.
I did this same a month ago, and now I have all samples for Weblogic Portal, Server and Workshop.
Goud -
Documentation for Avitek Medical Records 1.1
Have the Tutorials and the Architecture Guide for Avitek Medical Records been updated
for version 1.1 as well? I'm only able to find it for the previous 1.0 version.
/Regards MagnusMake sure that the xml is not split in the wrong spot. Cutting and pasting directly from the web page can put linebreaks in the wrong places.?:|
-
Avitek Medical Records UML Diagram
Hello,
I am trying to understand the design and system architecture of an "ideal"
J2EE application like Avitek Medical Records or Pet Store. I am unable to
find any UML diagrams for these application (I have found some architecture
notes for Avitek Medical Records in bea website)
If anyone can direct me to such UML diagrams I would be very greatfull.
Cheers
YogeshHello,
I am trying to understand the design and system architecture of an "ideal"
J2EE application like Avitek Medical Records or Pet Store. I am unable to
find any UML diagrams for these application (I have found some architecture
notes for Avitek Medical Records in bea website)
If anyone can direct me to such UML diagrams I would be very greatfull.
Cheers
Yogesh -
Dana Nourie tutorial - compiler error
For the ones that read the tutorial:
when i try to compile DiveLog.java this error appears:
divelog.java:77: cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Resources",
^
it repeats for all the other classes: Dives, Diver...
If you experienced this problem please tell me what to do.For the ones that read the tutorial:
when i try to compile DiveLog.java this error
appears:
divelog.java:77: cannot resolve symbol
symbol : method addTab
(java.lang.String,<null>,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Resources",
^
it repeats for all the other classes: Dives, Diver...
If you experienced this problem please tell me what to
do.tabbedPane.addTab("Resources", <- is there supposed to be a "," there -
Aviteck medical tutorial build error
Hello,
I am having errors while building the avitek medical records tutorial.
Where can I find more information or the newsgroup for the tutorialThis is the direct link to the examples newsgroups.
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xover&group=weblogic.develope
r.interest.examples
"sat" <[email protected]> wrote in message news:[email protected]..
>
Hello,
I am having errors while building the avitek medical records tutorial.
Where can I find more information or the newsgroup for the tutorial -
"asant build" for bookstore1 example in j2ee tutorial gives "compile error"
Hello everybody,
I am trying to run "asant build" command to build package for bookstore1 example given in j2ee tutorials.
I installed my j2ee tutorial 1.4 in "c:\java\j2eetutorial14" and my example is in "c:\java\j2eetutorial\examples\web\bookstore1".
My j2ee SDK with appliation server is installed in C:\sun\appserver.
When i run the "asant build" command in "c:\java\j2eetutorial\examples\web\bookstore1" directory i get compile error with last few lines as follows.
[javac] location: class servlets.ShowCartServlet
[javac] } catch (BookNotFoundException ex) {
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:136: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:136: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:137: cannot resolve symbol
[javac] symbol : class BookDetails
[javac] location: class servlets.ShowCartServlet
[javac] bd = (BookDetails) item.getItem();
[javac] ^
[javac] 69 errors
BUILD FAILED
file:C:/Java/j2eetutorial14/examples/web/bookstore1/build.xml:68: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Can some one please help me.
thanksWhen i run the "asant build" command in
"c:\java\j2eetutorial\examples\web\bookstore1"
directory i get compile error with last few lines as
follows.Did you package the bookstore common files as described in Chapter 3? My guess is that you didn't include bookstore.jar from <INSTALL>/j2eetutorial14/examples/build/web/bookstore/dist/.
-Ian Evans
Sun Microsystems
J2EE Tutorial team -
Compile error "table or view does not exist"
When I run the following code, I get a compile error:
Error(5,33): PL/SQL: ORA-00942: table or view does not exist
I can run the select statement by itself as an SQL query, so why does this not work in PL/SQL?
CREATE OR REPLACE
PROCEDURE PREPTEST AS
BEGIN
FOR rec IN (SELECT rep_id FROM diag.diag_rep )
LOOP
DBMS_OUTPUT.PUT_LINE(' record ID is ' || rec.rep_id);
END LOOP;
END;Within SQL the permissions can be taken from the Role that the user has.
Within PL/SQL permissions are not taken from Roles and have to be explicitly granted to the user.
GRANT the appropriate permissions to the user and the PL/SQL code will work. -
Warning: Procedure created with compilation errors.
I am trying to upload a pdf file into a blob column of a table. I get this error with these three ways of doing that:Warning: Procedure created with compilation errors.
Any ideas why?
-- THE STORAGE TABLE FOR THE IMAGE FILE
ALTER TABLE PDM
DROP PRIMARY KEY CASCADE;
DROP TABLE PDM CASCADE CONSTRAINTS;
CREATE TABLE PDM (
DNAME VARCHAR2(30), -- DIRECTORY NAME
SNAME VARCHAR2(30), -- SUBDIRECTORY NAME
FNAME VARCHAR2(30), -- FILE NAME
IBLOB BLOB); -- IMAGE FILE
-- CREATE THE PROCEDURE TO LOAD THE FILE
CREATE OR REPLACE PROCEDURE LOAD_FILE (
PDNAME VARCHAR2,
PSNAME VARCHAR2,
PFNAME VARCHAR2) IS
SRC_FILE BFILE;
DST_FILE BLOB;
LGH_FILE BINARY_INTEGER;
BEGIN
SRC_FILE := BFILENAME('PDF_DIR', '266-5210.pdf');
-- INSERT A NULL RECORD TO LOCK
INSERT INTO PDM
(DNAME, SNAME, FNAME, IBLOB)
VALUES
(PDNAME, PSNAME, PFNAME, EMPTY_BLOB())
RETURNING IBLOB INTO DST_FILE;
-- LOCK RECORD
SELECT IBLOB
INTO DST_FILE
FROM PDM
WHERE DNAME = PDNAME
AND SNAME = PSNAME
AND FNAME = PFNAME
FOR UPDATE;
-- OPEN THE FILE
DBMS_LOB.FILEOPEN(SRC_FILE, DBMS_LOB.FILE_READONLY);
DBMS_LOB.OPEN(DST_FILE, DBMS_LOB.LOB_READWRITE);
-- DETERMINE LENGTH
LGH_FILE := DBMS_LOB.GETLENGTH(SRC_FILE);
-- READ THE FILE
DBMS_LOB.LOADFROMFILE(DST_FILE, SRC_FILE, LGH_FILE);
-- UPDATE THE BLOB FIELD
UPDATE PDM
SET IBLOB = DST_FILE
WHERE DNAME = PDNAME
AND SNAME = PSNAME
AND FNAME = PFNAME;
-- CLOSE FILE
DBMS_LOB.FILECLOSE(SRC_FILE);
END LOAD_FILE;
-- THE STORAGE TABLE FOR THE IMAGE FILE
ALTER TABLE PDM
DROP PRIMARY KEY CASCADE;
DROP TABLE PDM CASCADE CONSTRAINTS;
CREATE TABLE PDM
FNAME VARCHAR2(1000)
,IBLOB BLOB
-- CREATE THE PROCEDURE TO LOAD THE FILE
CREATE OR REPLACE PROCEDURE LOAD_FILE AS (
SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
DST_FILE BLOB;
BEGIN
-- INSERT A NULL RECORD TO LOCK
INSERT INTO PDM
(FNAME, IBLOB)
VALUES
('262-2827.pdf', EMPTY_BLOB())
RETURNING IBLOB INTO DST_FILE;
-- OPEN THE FILE
DBMS_LOB.FILEOPEN(SRC_FILE, DBMS_LOB.FILE_READONLY);
DBMS_LOB.OPEN(DST_FILE, DBMS_LOB.LOB_READWRITE);
-- READ THE FILE
DBMS_LOB.LOADFROMFILE( SRC_FILE, DST_FILE);
-- UPDATE THE BLOB FIELD
UPDATE PDM
SET FNAME = SRC_FILE,
IBLOB = DST_FILE;
-- CLOSE FILE
DBMS_LOB.CLOSE(DST_FILE);
DBMS_LOB.FILECLOSE(SRC_FILE);
COMMIT;
END LOAD_FILE;
ALTER TABLE IMAGE_TABLE
DROP PRIMARY KEY CASCADE;
DROP TABLE IMAGE_TABLE CASCADE CONSTRAINTS;
CREATE TABLE IMAGE_TABLE (
ID NUMBER PRIMARY KEY,
IMAGE ORDSYS.ORDIMAGE);
CREATE OR REPLACE DIRECTORY IMAGEDIR AS 'C:\cards\';
GRANT READ ON DIRECTORY IMAGEDIR TO PUBLIC;
GRANT READ ON DIRECTORY MY_FILES TO twilliam;
GRANT READ ON DIRECTORY MY_FILES TO tmwillia;
CREATE OR REPLACE PROCEDURE IMAGE_IMPORT(DEST_ID NUMBER,
FILENAME VARCHAR2)
IS
IMG ORDSYS.ORDIMAGE;
CTX RAW(64) := NULL;
BEGIN
DELETE FROM IMAGE_TABLE
WHERE ID = DEST_ID;
INSERT INTO IMAGE_TABLE (ID, IMAGE)
VALUES (DEST_ID, ORDSYS.ORDIMAGE.INIT())
RETURNING IMAGE INTO IMG;
IMG.IMPORTFROM(CTX, 'FILE', 'IMAGEDIR', FILENAME);
UPDATE IMAGE_TABLE SET IMAGE=IMG WHERE ID=DEST_ID;
END
CALL IMAGE_IMPORT(7142,'125-0502.pdf');
CALL IMAGE_IMPORT(7143,'125-0503.pdf');
SELECT ID,
T.IMAGE.GETHEIGHT(),
T.IMAGE.GETWIDTH()
FROM IMAGE_TABLE T;
SELECT ID,
T.IMAGE.GETFILEFORMAT(),
T.IMAGE.GETCOMPRESSIONFORMAT()
FROM IMAGE_TABLE T;
SELECT ID,
T.IMAGE.GETCONTENTFORMAT(),
T.IMAGE.GETCONTENTLENGTH()
FROM IMAGE_TABLE T;In the second load_file procedure you should probably change the update command
-- UPDATE THE BLOB FIELD
UPDATE PDM
SET FNAME = SRC_FILE,
IBLOB = DST_FILE;into this
-- UPDATE THE BLOB FIELD
UPDATE PDM
SET IBLOB = DST_FILE
WHERE FNAME = '262-2827.pdf';but I'm not sure how to explain the eof error message. Usually this happens when you forget an "END;" or "END LOOP;" command.
Ok I rechecked and the declaration of the second procedure seems wrong
-- CREATE THE PROCEDURE TO LOAD THE FILE
CREATE OR REPLACE PROCEDURE LOAD_FILE AS (
SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
DST_FILE BLOB;
BEGINshould be rewritten as
-- CREATE THE PROCEDURE TO LOAD THE FILE
CREATE OR REPLACE PROCEDURE LOAD_FILE
AS
SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
DST_FILE BLOB;
BEGIN
...I removed one parenthesis which was not closed.
And for the image_import procedure there is a semikolon missing after the final END.
END*;*
Edited by: Sven W. on Nov 24, 2008 5:54 PM.
Edited by: Sven W. on Nov 24, 2008 5:56 PM
Edited by: Sven W. on Nov 24, 2008 5:59 PM -
Sun ejb tutorial compilation problem with sample code
I have been trying to follow the ejb tutorial off of Sun's web site. However, I get the following problem when I try to compile the sample code.
prompt>javac Demo.java
works fine
Prompt>javac DemoBean.java
works fine
Prompt>javac DemoHome.java
DemoHome.java:23: cannot resolve symbol
symbol : class Demo
location: interface ejb.demo.DemoHome
public Demo create() throws CreateException, RemoteException;
^
1 error
Prompt>
Can anyone help me out as I have tried several books which conveniently skip the part about compiling errors.
I noticed I don't have a CLASSPATH variable and then i created one with just '.' in it and that didn't work. any help would be appreciated as this is driving me crazy. Thanks.try to change the order of the exception.
first RemoteException and then CreateException -
No. of Vowels in an user input sentence - Compilation Error
I tried the following program to find the number of vowels in a given sentence :
//Number of vowels in a given line
import java.util.Scanner;
class vowels
public static void main(String args[])
int a,b,y=0;
String x;
Scanner inpt = new Scanner(System.in);
System.out.println("Enter a line of text to find out the number of vowels in it");
x = inpt.nextLine();
char[] c = x.toCharArray();
b = c.length;
for(a=1;a<=b;a++)
if(c[a]=='a'||c[a]=='e'||c[a]=='i'||c[a]=='o'||c[a]=='u')
y++;
System.out.println("The numbner of vowels in the given line of text is :" + y);
}But when I run the program, I get the following output :
Enter a line of text to find out the number of vowels in it
Honduras
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at vowels.main(vowels.java:16)
Java Result: 1
BUILD SUCCESSFUL (total time: 18 seconds)
I use Netbeans IDE 6.5.1. Plz help meIt's not a compilation error; it's a runtime error.
The error message is telling you exactly what's wrong.
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at vowels.main(vowels.java:16)At line 16 of vowels.java, you're trying to access the 9th element (index 8) of an array that has at most 8 elements (at indices 0..7).
Go take another look at a java array tutorial. -
Deprecated API compilation error
Please help. Attached is my source code. I'm receiving a compilation error that reads 'RnrBooksApp.java uses or overrides a deprecated API. Recompile with -deprecation for details.' I'm very new to Java, so I appreciate any assistance. Thank you!
//ClassName: RnrBooksApp
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
public class RnrBooksApp extends Frame implements ItemListener, ActionListener
//Declare database variables
Connection conBook;
Statement cmdBook;
ResultSet rsBook;
boolean blnSuccessfulOpen = false;
//Declare components
Choice lstBooks = new Choice();
TextField txtISBN = new TextField(13);
TextField txtTitle = new TextField(50);
TextField txtAuthor = new TextField(30);
TextField txtPublisher = new TextField(30);
Button btnAdd = new Button("Add");
//Button btnUpdate = new Button("Update");
Button btnEdit = new Button("Save");
Button btnCancel = new Button("Cancel");
Button btnDelete = new Button("Delete");
Label lblMessage = new Label(" ");
public static void main(String args[])
//Declare an instance of this application
RnrBooksApp thisApp = new RnrBooksApp();
thisApp.createInterface();
public void createInterface()
//Load the database and set up the frame
loadDatabase();
if (blnSuccessfulOpen)
//Set up frame
setTitle("Books Database");
addWindowListener(new WindowAdapter()
public void windowClosing(WindowEvent event)
stop();
System.exit(0);
setLayout(new BorderLayout());
//Set up top panel
Panel pnlTop = new Panel(new GridLayout(2, 2, 10, 10));
pnlTop.add(new Label("ISBN"));
lstBooks.insert("Select a Book to Display", 0);
lstBooks.addItemListener(this);
pnlTop.add(lstBooks);
pnlTop.add(new Label(" "));
add(pnlTop, "North");
//Set up center panel
Panel pnlMiddle = new Panel(new GridLayout(5, 2, 10, 10));
pnlMiddle.getInsets();
pnlMiddle.add(new Label("ISBN"));
pnlMiddle.add(txtISBN);
pnlMiddle.add(new Label("Title"));
pnlMiddle.add(txtTitle);
pnlMiddle.add(new Label("Author"));
pnlMiddle.add(txtAuthor);
pnlMiddle.add(new Label("Publisher"));
pnlMiddle.add(txtPublisher);
setTextToNotEditable();
Panel pnlLeftButtons = new Panel(new GridLayout(0, 2, 10, 10));
Panel pnlRightButtons = new Panel(new GridLayout(0, 2, 10, 10));
pnlLeftButtons.add(btnAdd);
btnAdd.addActionListener(this);
pnlLeftButtons.add(btnEdit);
btnEdit.addActionListener(this);
pnlRightButtons.add(btnDelete);
btnDelete.addActionListener(this);
pnlRightButtons.add(btnCancel);
btnCancel.addActionListener(this);
btnCancel.setEnabled(false);
pnlMiddle.add(pnlLeftButtons);
pnlMiddle.add(pnlRightButtons);
add(pnlMiddle, "Center");
//Set up bottom panel
add(lblMessage, "South");
lblMessage.setForeground(Color.red);
//Display the frame
setSize(400, 300);
setVisible(true);
else
stop(); //Close any open connection
System.exit(-1); //Exit with error status
public Insets insets()
//Set frame insets
return new Insets(40, 15, 15, 15);
public void loadDatabase()
try
//Load the Sun drivers
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch (ClassNotFoundException err)
try
//Load the Microsoft drivers
Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
catch (ClassNotFoundException error)
System.err.println("Drivers did not load properly");
try
//Connect to the database
conBook = DriverManager.getConnection("jdbc:odbc:Book");
//Create a ResultSet
cmdBook = conBook.createStatement();
rsBook = cmdBook.executeQuery(
"Select * from Book;");
loadBooks(rsBook);
blnSuccessfulOpen = true;
catch(SQLException error)
System.err.println("Error: " + error.toString());
public void loadBooks(ResultSet rsBook)
//Fill ISBN list box
try
while(rsBook.next())
lstBooks.add(rsBook.getString("ISBN"));
catch (SQLException error)
System.err.println("Error in Display Record." + "Error: " + error.toString());
public void itemStateChanged(ItemEvent event)
//Retrieve and display the selected record
String strISBN = lstBooks.getSelectedItem();
lblMessage.setText(""); //Delete instructions
try
rsBook = cmdBook.executeQuery(
"Select * from Book where [ISBN] = '"
+ strISBN + "';");
txtISBN.setText(strISBN);
displayRecord(rsBook);
setTextToEditable();
catch(SQLException error)
lblMessage.setText("Error in result set. " + "Error: " + error.toString());
public void displayRecord(ResultSet rsBook)
//Display the current record
try
if(rsBook.next())
txtTitle.setText(rsBook.getString("Title"));
txtAuthor.setText(rsBook.getString("Author"));
txtPublisher.setText(rsBook.getString("Publisher"));
lblMessage.setText("");
else
lblMessage.setText("Record not found");
clearTextFields();
catch (SQLException error)
lblMessage.setText("Error: " + error.toString());
public void actionPerformed(ActionEvent event)
//Test the command buttons
Object objSource = event.getSource();
if(objSource == btnAdd && event.getActionCommand () == "Add")
Add();
else if (objSource == btnAdd)
Save();
else if(objSource == btnEdit)
Edit();
else if(objSource == btnDelete)
Delete();
else if(objSource == btnCancel)
Cancel();
public void setTextToNotEditable()
//Lock the text fields
txtISBN.setEditable(false);
txtTitle.setEditable(false);
txtAuthor.setEditable(false);
txtPublisher.setEditable(false);
public void setTextToEditable()
//Unlock the text fields
txtISBN.setEditable(true);
txtTitle.setEditable(true);
txtAuthor.setEditable(true);
txtPublisher.setEditable(true);
public void clearTextFields()
//Clear the text fields
txtISBN.setText("");
txtTitle.setText("");
txtAuthor.setText("");
txtPublisher.setText("");
public void Add()
//Add a new record
lblMessage.setText(" "); //Clear previous message
setTextToEditable(); //Unlock the text fields
clearTextFields(); //Clear text field contents
txtISBN.requestFocus ();
//Set up the OK and Cancel buttons
btnAdd.setLabel("OK");
btnCancel.setEnabled(true);
//Disable the Delete and Edit buttons
btnDelete.setEnabled(false);
btnEdit.setEnabled(false);
public void Save()
//Save the new record
// Activated when the Add button has an "OK" label
if (txtISBN.getText().length ()== 0 || txtAuthor.getText().length() == 0)
lblMessage.setText("The ISBN or Author is blank");
else
try
cmdBook.executeUpdate("Insert Into Book "
+ "([ISBN], [Title], [Author], [Publisher]) "
+ "Values('"
+ txtISBN.getText() + "', '"
+ txtTitle.getText() + "', '"
+ txtAuthor.getText() + "', '"
+ txtPublisher.getText() + "')");
//Add to name list
lstBooks.add(txtISBN.getText());
//Reset buttons
Cancel();
catch(SQLException error)
lblMessage.setText("Error: " + error.toString());
public void Delete()
//Delete the current record
int intIndex = lstBooks.getSelectedIndex();
String strISBN = lstBooks.getSelectedItem();
if(intIndex == 0) //Make sure a record is selected
//Position 0 holds a text message
lblMessage.setText("Please select the record to be deleted");
else
//Delete the record from the database
try
cmdBook.executeUpdate(
"Delete from Book where [ISBN] = '" + strISBN + "';");
clearTextFields(); //Delete from screen
lstBooks.remove(intIndex); //Delete from list
lblMessage.setText("Record deleted"); //Display message
catch(SQLException error)
lblMessage.setText("Error during Delete."
+ "Error: " + error.toString());
public void Cancel()
//Enable the Delete and Edit buttons
btnDelete.setEnabled(true);
btnEdit.setEnabled(true);
//Disable the Cancel button
btnCancel.setEnabled(false);
//Change caption of button
btnAdd.setLabel("Add");
//Clear the text fields and status bar
clearTextFields();
lblMessage.setText("");
public void Edit()
//Save the modified record
int intIndex = lstBooks.getSelectedIndex();
if(intIndex == 0) //Make sure a record is selected
//Position 0 holds a text message
lblMessage.setText("Please select the record to change");
else
String strISBN = lstBooks.getSelectedItem();
try
cmdBook.executeUpdate("Update Book "
+ "Set [ISBN] = '" + txtISBN.getText() + "', "
+ "[Title] = '" + txtTitle.getText() + "', "
+ "[Author] = '" + txtAuthor.getText() + "', "
+ "[Publisher] = '" + txtPublisher.getText() + "' "
+ "Where [ISBN] = '" + strISBN + "';");
if (!strISBN.equals(txtISBN.getText()))
//Last name changed; change the list
lstBooks.remove(intIndex); //Remove the old entry
lstBooks.add(txtISBN.getText()); //Add the new entry
catch(SQLException error)
lblMessage.setText("Error during Edit. " + "Error: " + error.toString());
public void stop()
//Terminate the connection
try
if (conBook != null)
conBook.close();
catch(SQLException error)
lblMessage.setText("Unable to disconnect");How DO you compile then?
If you don't type "javac", you must be using an IDE.
In your IDE there should be some kind of configuration
tab or option for "compiler options" or compilation options
or compiler arguments... something like that.
put "-deprecation" in that text box and recompile.
Your compiler should tell you all about which methods
are deprecated -- you then go to your trust JavaDocs
and lookup those methods in the API and read WHY they
are deprecated (i.e. OLD, outdated, defunct, no longer used)
and what you should use instead. Then, correct your
code to no longer use the deprecated methods and instead
do things as suggested in the deprecation comments. -
TRIM() not found? Compile error: Can't find project or library in Excel 2007
I am preparing to make a few alterations to a spreadsheet that another person built. I have NOT made any changes to it yet.
They put in a button that allows portions of the worksheet to print. I am now using Excel 2007. Their code ran fine in 2003.
The button had worked in Excel 2003- but now (without any changes) throws an error "Compile Error: Cant find project or library."
TRIM is highlighted in the following code: (See below for the whole sub)
If Trim(Worksheets("Measurements").Cells(RowCounter, ColumnCounter).Value) <> "" Then
If RowCounter > PrintRowMarker Then
PrintRowMarker = RowCounter
End If
If ColumnCounter > PrintColumnMarker Then
PrintColumnMarker = ColumnCounter + 1
End If
End If
I have added in the following references into Excel via the big button in the upper left and the "Excel Options" screens:
Analysis Toolpak and Analysis Toolpak-VBA. The sheet "Measurements" is present.
1) Are these the right packages for the TRIM function?
2) Is there a different Add-in that is needed?
3) Is there an additional step I must use to actually add in these packages?
4) Is there something else I should do?
Thanks-
Loralee
P.S. Access 2003 finds (it's version of) TRIM fine- so a version is on the machine. This spreadsheet if failing in the same way on 2 machines- both with Office 2007 installed.
Private Sub BtnPrint_Click()
Dim RowStarter As Integer 'Where to start checking rows for content
Dim RowCounter As Integer 'The current row being checked
Dim ColumnCounter As Integer 'The current column being checked
Dim PrintRowMarker As Long 'The last row with data
Dim PrintColumnMarker As Long 'The last column with data
Dim NoMoreData As Boolean 'Look for a blank record
Dim RangeValue As String 'Define the range string value
Dim EndRangeValue As String
PrintColumnMarker = 0
PrintRowMarker = 0 'Initialize the row printing marker
RowStarter = 5 'Print Starting Point
For RowCounter = 2005 To RowStarter Step -1
For ColumnCounter = 50 To 2 Step -1
If Trim(Worksheets("Measurements").Cells(RowCounter, ColumnCounter).Value) <> "" Then
If RowCounter > PrintRowMarker Then
PrintRowMarker = RowCounter
End If
If ColumnCounter > PrintColumnMarker Then
PrintColumnMarker = ColumnCounter + 1
End If
End If
Next ColumnCounter
If PrintRowMarker > 0 Then
End If
Next RowCounter
EndRangeValue = IndexToString(PrintRowMarker, PrintColumnMarker)
RangeValue = "$A$1:" & EndRangeValue
Worksheets("Measurements").PageSetup.PrintArea = RangeValue
Worksheets("Measurements").PageSetup.PrintGridlines = True 'Turn on gridlines
Worksheets("Measurements").PrintPreview 'PRINT THAT PUPPY!
End SubAppears OK to me but the error message " Cant find project or library." suggests it could possibly be the references in VBA.
In VBA select menu item Tools - References.
Ensure that the following are checked:-
Visual Basic for Applications
Microsoft Excel 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Object Library
It there are any references displayed as Missing then scroll down to find the equivalent reference and check it and then uncheck the Missing one/s.
Regards, OssieMac -
Compiler error using compareTo
I get a compiler error when I use compareTo with the Character class. I confirmed the error with following code from The Java Tutorial:
public class CharacterDemo {
public static void main(String args[]) {
Character a = new Character('a');
Character a2 = new Character('a');
Character b = new Character('b');
// ******* Problem is here ************
int difference = a.compareTo(b);
if (difference == 0) {
System.out.println("a is equal to b.");
} else if (difference < 0) {
System.out.println("a is less than b.");
} else if (difference > 0) {
System.out.println("a is greater than b.");
System.out.println("a is "
+ ((a.equals(a2)) ? "equal" : "not equal")
+ " to a2.");
System.out.println("The character " + a.toString() + " is "
+ (Character.isUpperCase(a.charValue()) ? "upper" : "lower")
+ "case.");
The compilier is complaining that compareTo is not part of the Character class. I am compiling with whatever compilier was installed with Suse Linux 7.1. The code compiles fine on my university's Unix system that I can dial into.
I figure my Linux version must have some old compiler. But to be honest, I am also new to Linux and am having trouble figuring out what I am compiling with. Can any expert out there give me advice on identifying/updating the Java technology I am using. Thanks in advance.
JimCheck the jdk version using the java command:
java -versionwhich will output the jdk version you're using. -
Help with Data Block Based on Procedure--getting compilation error
I am trying to create a datablock based on a procedure , but im getting errors in compilation:
Errors are :
1) identifier 'HSM_WSH_DEL_UTIL.DEL_TBL' must be declared
2)PL/SQL ERROR 320 at line 7, column 27
the declaration of the type of this expression is incomplete or malformed
ANy Help would be appreciated !
Heres my pkg spec and body for the data block:
CREATE OR REPLACE PACKAGE hsm_wsh_del_util IS
TYPE del_record is record
(delivery_id number);
TYPE del_tbl is table of del_record INDEX BY BINARY_INTEGER;
procedure do_query(p_del IN OUT del_tbl);
END hsm_wsh_del_util ;
CREATE OR REPLACE PACKAGE BODY hsm_wsh_del_util IS
procedure do_query(p_del IN OUT del_tbl)
IS
idx number :=1;
CURSOR DELIVERY IS
SELECT DELIVERY_ID
FROM abc_deliveries;
begin
FOR CUR IN DELIVERY LOOP
p_del(idx).delivery_id :=cur.delivery_id;
idx:= idx+1;
END LOOP;
end do_query;
END hsm_wsh_del_util;
Edited by: 981170 on Mar 13, 2013 1:08 PMHi,
Yes I did use the wizard,
I agve it the package.proc name for query.
it pulled up the field delivery ID,
Hit finish, because I do not need update/delete/inserts.
the query data source columns and arguments was defaulted correctly.
THe QUERY-PROCEDURE was built by default.
It is giving me an error though: wrong number or types of arguments in call to POPULATE_BLOCK..
DECLARE
bk_data HSM_WSH_DEL_UTIL.DEL_TBL;
BEGIN
hsm_wsh_del_util.do_query(bk_data);
PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'NEW_DELIVERIES');
END;
Maybe you are looking for
-
"Startup Disk is Full" even though I have 3.5 GB free
I just upgraded my RAM from 2 GB to 4 GB yesterday (2 x 2GB Kingston DDR2), and today I'm getting a message that my "startup disk is full," even though I have 3.5 GB of space on my hard drive. I've gotten this message in the past when I only have 100
-
How far back in time does iCal go (accurately)?
Silly question, I know, but is there a built in limit or a point at which iCal becomes inaccurate?
-
How can I adjust video from two cameras that are out of sync?
Hi - I've just recorded someone speaking on two cameras with the intention of cutting clips in from the second camera while using the video and soundtrack from the main camera, however the two video files are out of sync by half a second or so by the
-
How to create dynamic combobox
hi Gurus, I have a jsp page and I want to setup a combobox on it that will get clientnames from the databse(mysql). Can someone give me source code to get the job done. I have class for connection. here is my code for class package admin; import java
-
How to Limit text in Textedit element
Hi I am using a BSP application named CRM_IC, which is using "TextEdit" Element & i want to limit the text entered in it. Is there any property like Maxlength in BSP as its there in HTML. Thanks & regards Abhay