Database and java class
Is there a tool that automatic create a java class related to a database? Similar dataset in .NET?
create a database? nyet.
There are relational databases written in Java and there are tools in java with which one can access a DBMS.
Either use a search engine, look at the java.sql and javax.sql packages, or post more information.
Similar Messages
-
(261680070) Q SYNCH-11 How do my web service methods accees EJBs and java classes?
A<SYNCH-11> How do my web service methods accees EJBs and java classes?
A<SYNCH-11> It is simple to use java classes, just do it as you would ordinarily.
The .jws file really contains a simple class so you can program with it in the same
way that you would use a regular Java class.
To use an EJB you can go and access it directly as you would with any EJB remote
client (lookup home stub, create, etc) or if the EJB is deployed to WLS you can use
a control to provide a very simple wrapper to the EJB. We will see this in detail
on Thursday in the ADVC module.Futher information about the possibility of callback:
It may be possible for a synchronous only web service (i.e. MS .net) to even paticipant
in the callback functionality of asynchronous web services. If the client implements
the appropriate methods for the callback but listens for them on a different port
or binding than the SOAP request, then web service may be able to build a response
if the client's "callback URL" is submitted as the beginning part of a conversation.
Watch the BEA developer forum (http://dev2dev.bea.com) for more information about
this approach and other tips and techniques for building web services.
"Adam FitzGerald" <[email protected]> wrote:
>
Q<SYNCH-03> I heard that MS .net only implements synchrnonus method? If
this is true.
Does it means my async methods will only work with J2EE clients?
A<SYNCH-03> I do not know the limitations of .net but let me point out that
is very
difficult to provide asynchronous web service method invocation (this is
different
from an asynchronous web service). HTTP as a general communication protocol
is based
on a request and response paradigm so your client libraries will mostly
likely be
expecting a response even if it is empty (check the asynchronous example
from today
to see that the start method still returns an empty response). You must
distinguish
this from the notion of an asynchronous web service which is a business
operation
that occurs on the server whose return value/result is not directly associated
with
building response to the client. An asynchronous web service can (and generally
will)
be started and stopped with web service operations that are invoked synchronously.
Thus MS .net clients can still be client to WLS hosted web services. -
JSP, Servlet, and Java Classes location in Tomcat
In tomcat, I want to know JSP files, Servlets, and Java classes
should put in different locations:
I put web.xml in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF
I put all JSP files in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1
I put all servlet files in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes
I put all Java classes in the following with package proj1:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes\proj1
When I execute JSP files, it has HTTP error 404, file not found.
The content of web.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>proj1</display-name>
<description>
proj1
</description>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Please advise. thanks!!!<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>Where's the servlet definition that maps to "invoker"? -
Deploying the JSPs, Servlets and Java class files
Hello All,
I'm very new to the Oracle 9i AS. We are using Version 1.0.2.2.
How do we deploy the JSPs, Servlets, and Java class files (simple class files, not EJBs)?
plese give us the procedure and stpes how to deply or the links for the same.
Thanks,
Santhosh.Hi
I guess u r running apache-jserv as servlet engine for your jsp and servlets. If its so, jsp files can be run without any additonal configuration by putting the jsp file under document root or any subdirectory and for running servlets u have to add classpath entries for your servlet in jserv.properties file.
To make sure that your servlet engine is working, try
http://servername:port/servlet/IsItWorking, if u get success msg that means servlet engine is working fine.
Hope this will help
Regards
Kumaran -
Function and java class problem
Hi, i`m trying to develop a function that is using java class in body and return a table. I will show some code for better understanding.
I`m creating TYPE:
CREATE TYPE TYP1 AS OBJECT (
NUMER NUMBER,
NAZWA VARCHAR2(5),
KLOB CLOB,
RESULTS VARCHAR2(255));
CREATE TYPE TYP1_TAB IS TABLE OF TYP1;
Then im creating function
CREATE OR REPLACE FUNCTION GET_TAB(P_CURS SYS_REFCURSOR) RETURN TYP1_TAB PIPELINED IS
OUT_REC TYP1:=TYP1(NULL,NULL,NULL);
BEGIN
LOOP
FETCH P_CURS INTO OUT_REC.NUMER,OUT_REC.NAZWA,OUT_REC.KLOB;
//here i need to pass some parameters to java class stored in my database,
something like:
java_class(numer,nazwa,klob) return RESULTS and fetch them to out_rec.results;
EXIT WHEN P_CURS%NOTFOUND;
PIPE ROW(OUT_REC);
END LOOP;
RETURN;
END;
Please help me..
Best regards
RadekHi this is the Oracle Designer forum. You would be better off asking this question over at the SQL & PL/SQL place
PL/SQL -
I am almost finished with this program, but I am getting a strange error. Here is the assignment description: http://condor.depaul.edu/~jpetlick/extra/212/A07_212.html I would greatly appreciate any help. Thank you! (I know I eventually need to output this to files, but I currently left that out for debugging purposes.)
-------------Error Message------------------------
The balance of accounts prior to money transfers is:
Account Balance
1 $10,000.00
2 $10,000.00
3 $10,000.00
4 $10,000.00
5 $10,000.00
6 $10,000.00
7 $10,000.00
8 $10,000.00
9 $10,000.00
10 $10,000.00
Total $100,000.00
TranID From Balance to Balance
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
-------------------Code----------------------
import java.sql.*;
import java.util.*;
import java.io.*;
import java.text.NumberFormat;
public class Transfer
public static void main(String[] args)
throws ClassNotFoundException, SQLException, IOException
String file = "Report.dat", file2 = "Log.dat", sql = "";
int sum = 0, trans = 1, accountWithdraw = 0, accountDeposit = 0, total = 0;
int randomAcctWithdraw = 0, randomAcctDepo = 0;
//-----Load database driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//-----File Writers
FileWriter fw = new FileWriter (file);
BufferedWriter bw = new BufferedWriter (fw);
PrintWriter outFile = new PrintWriter (bw);
FileWriter fw2 = new FileWriter (file2);
BufferedWriter bw2 = new BufferedWriter (fw2);
PrintWriter outFile2 = new PrintWriter (bw2);
NumberFormat money = NumberFormat.getCurrencyInstance();
try
//-----Create Database Connection object.
Connection c = DriverManager.getConnection("jdbc:odbc:Banking");
//-----Create Statement object.
Statement s = c.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
s.execute("CREATE TABLE MyBank " + "(AccountNum Number, Balance Number)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('1', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('2', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('3', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('4', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('5', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('6', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('7', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('8', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('9', 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "('10', 10000)");
String selection = "SELECT AccountNum, Balance FROM MyBank";
ResultSet r = s.executeQuery(selection);
System.out.println ("The balance of accounts prior to money transfers is:");
System.out.println ("\tAccount\t Balance");
while(r.next())
System.out.println("\t" + r.getInt(1) + "\t" + money.format(r.getInt(2)));
sum += r.getInt(2);
System.out.println("\tTotal\t" + money.format(sum));
System.out.println ("\nTranID\tFrom\tBalance\tto\tBalance");
r = s.executeQuery(selection);
r.first();
for (int i=0; i <= 1000; i++)
accountWithdraw = (int) ((Math.random() * 10) + 1);
accountDeposit = (int) ((Math.random() * 10) + 1);
r.first();
while(r.next())
while ( (accountWithdraw == r.getInt(1)) || (accountWithdraw == accountDeposit) )
accountWithdraw = (int) ((Math.random() * 10) + 1);
accountDeposit = (int) ((Math.random() * 10) + 1);
r.absolute(accountWithdraw);
s.executeUpdate("UPDATE MyBank SET Balance = " + (r.getInt(2) - 1000) + " WHERE AccountNum = " + accountWithdraw);
r = s.executeQuery(selection);
r.absolute(accountDeposit);
s.executeUpdate("UPDATE MyBank SET Balance = " + (r.getInt(2) + 1000) + " WHERE AccountNumber = " + accountDeposit);
System.out.print (trans + "\t" + accountWithdraw + "\t" + s.executeQuery("SELECT Balance FROM MyBank WHERE AccountNum = " + accountWithdraw) + "\t" + accountDeposit + "\t" + s.executeQuery("SELECT Balance FROM MyBank WHERE AccountNum = " + accountDeposit));
r.first();
trans++;
r.first();
System.out.println ("\nThe balance of accounts after money transfers is:");
System.out.println ("\tAccount\t Balance");
while (r.next())
System.out.println("\t" + r.getInt(1) + "\t" + money.format(r.getInt(2)));
total += r.getInt(2);
System.out.println ("\tTotal: " + money.format(total));
//-----Close Connections
c.close();
catch(SQLException err)
System.out.println (err);Well I changed some thing and it seems as if I'm so close but I keep getting this error. The wierd thing is it doesn't always break there. Sometimes it breaks at 14 transactions, sometimes 85, all kinds of numbers. I can't figure that out. Thanks for all the help, i appreciate it.
The balance of accounts prior to money transfers is:
Account Balance
1 $10,000.00
2 $10,000.00
3 $10,000.00
4 $10,000.00
5 $10,000.00
6 $10,000.00
7 $10,000.00
8 $10,000.00
9 $10,000.00
10 $10,000.00
Total $100,000.00
TranID From Balance to Balance
1 8 9000 6 11000
2 3 9000 9 11000
3 7 9000 8 10000
4 10 9000 9 12000
5 1 9000 9 13000
6 4 9000 8 11000
7 8 10000 6 12000
8 5 9000 9 14000
9 7 8000 2 11000
10 3 8000 9 15000
11 9 14000 2 12000
12 8 9000 10 10000
13 4 8000 3 9000
14 8 8000 10 11000
15 3 8000 2 13000
16 10 10000 9 15000
17 5 8000 7 9000
18 9 14000 1 10000
19 3 7000 5 9000
20 9 13000 3 8000
21 3 7000 8 9000
22 8 8000 6 13000
23 7 8000 2 14000
24 3 6000 4 9000
25 1 9000 5 10000
26 8 7000 1 10000
27 4 8000 5 11000
java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6287)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataInteger(JdbcOdbc.java:3211)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataInteger(JdbcOdbcResultSet.java:5434)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:571)
at Transfer.main(Transfer.java:76)
My altered code:
import java.sql.*;
import java.util.*;
import java.io.*;
import java.text.NumberFormat;
public class Transfer
public static void main(String[] args)
throws ClassNotFoundException, SQLException, IOException
String file = "Report.dat", file2 = "Log.dat", sql = "";
int sum = 0, trans = 1, accountWithdraw = 0, accountDeposit = 0, total = 0;
//-----Load database driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//-----File Writers
FileWriter fw = new FileWriter (file);
BufferedWriter bw = new BufferedWriter (fw);
PrintWriter outFile = new PrintWriter (bw);
FileWriter fw2 = new FileWriter (file2);
BufferedWriter bw2 = new BufferedWriter (fw2);
PrintWriter outFile2 = new PrintWriter (bw2);
NumberFormat money = NumberFormat.getCurrencyInstance();
try
//-----Create Database Connection object.
Connection c = DriverManager.getConnection("jdbc:odbc:Banking");
//-----Create Statement object.
Statement s = c.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
s.execute("CREATE TABLE MyBank " + "(AccountNum Number, Balance Number)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(1, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(2, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(3, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(4, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(5, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(6, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(7, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(8, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(9, 10000)");
s.executeUpdate("INSERT INTO MyBank VALUES " + "(10, 10000)");
String selection = "SELECT AccountNum, Balance FROM MyBank";
ResultSet r = s.executeQuery(selection);
System.out.println ("The balance of accounts prior to money transfers is:");
System.out.println ("\tAccount\t Balance");
while(r.next())
System.out.println("\t" + r.getInt(1) + "\t" + money.format(r.getInt(2)));
sum += r.getInt(2);
System.out.println("\tTotal\t" + money.format(sum));
System.out.println ("\nTranID\tFrom\tBalance\tto\tBalance");
r = s.executeQuery(selection);
r.first();
for (int i=0; i <= 1000; i++)
r.first();
while(r.next())
accountWithdraw = (int) ((Math.random() * 10) + 1);
accountDeposit = (int) ((Math.random() * 10) + 1);
while ( (accountWithdraw == r.getInt(1)) || (accountWithdraw == accountDeposit) )
accountWithdraw = (int) ((Math.random() * 10) + 1);
accountDeposit = (int) ((Math.random() * 10) + 1);
r.absolute(accountWithdraw);
s.executeUpdate("UPDATE MyBank SET Balance = " + (r.getInt(2) - 1000) + " WHERE AccountNum = " + accountWithdraw);
r = s.executeQuery(selection);
r.absolute(accountWithdraw);
System.out.print (trans + "\t" + accountWithdraw + "\t" + r.getInt(2) + "\t" + accountDeposit + "\t");
r.absolute(accountDeposit);
s.executeUpdate("UPDATE MyBank SET Balance = " + (r.getInt(2) + 1000) + " WHERE AccountNum = " + accountDeposit);
r = s.executeQuery(selection);
r.absolute(accountDeposit);
System.out.println (r.getInt(2));
r.first();
trans++;
r.first();
System.out.println ("\nThe balance of accounts after money transfers is:");
System.out.println ("\tAccount\t Balance");
while (r.next())
System.out.println("\t" + r.getInt(1) + "\t" + money.format(r.getInt(2)));
total += r.getInt(2);
System.out.println ("\tTotal: " + money.format(total));
//-----Close Connections
c.close();
catch(SQLException err)
err.printStackTrace(System.out);
} -
Hello,
I have list of java classes. I have one java class which calls only the required functions from the list of java classes. When I try to create a VI on that java class I see all the functions needed but all of them are grayed.
Can anybody please help?
Best regards,
DharmiHas anyone else solved this problem? We too are experiencing the same problem.
We are trying to build a .JWS file from within an ANT build script. The build script compiles the site into a single EAR file that should contain a deployable and usable JWS component, however it obviously does not.
If anyone has a solution, please let us know. We're facing a code freeze on this project by this Friday and really need some help. -
Hi...
My Bpel process accesses some java objects..To keep classes and projects separate I am keepin these classes in a war/ear and deploying it on oc4j...do u think the process can access the java classes in .war file..
I know i can have the java classes along with process source and copy the libs in BPEL-INF/lib but was trying to keep the code separate..
The process when compiled and built is packaged into .jar archive ..If we can drop this jar in an .ear package and deploy it probablythen the process can access the java classes..Can I access samples for the same?..
Thanks
BhupinderI don't believe you can access java objects from a war/ear, at least I wasn't able to get it working.
We have been jar'ing the objects up and placing them in C:\OraBPELPM_1\integration\orabpel\system\appserver\oc4j\j2ee\home\applib where the apps server can find them.
Toby -
Hi,
I am trying to call a java class using cfobject tag.
I placed my all classes under D:\cfm\ecpay\classes folder .
And add this path to jvm.config file.
I am getting class Not Found Exception while running my page.
Here is the code of cfobject
<cfobject
type = "java"
name = "myObj"
class = "ExcelToDb2"
action = "create">
<cfset ret = myObj.init()>
can some help me out on this.
ThanksIt is pretty straight forward and I think there would be a
problem for "Classpath". Please check it again in your CF admin.
There would be also syntax error.
Restarting the server is also required in case you compile a
new class etc.
Alternatively you can copy your classes into the directory
"cfroot\wwwroot\WEB-INF\classes" and restart the server before
testing them. -
I'm trying to pro-actively solve the timezone issue of
capturing and displaying data in local time for a global audience.
I found the timezone.cfc stuff (which looks like it should do a
great job), but can't seem to get it to initialize.
When it makes the call:
variables.timeZone=loader.loadClass("com.ibm.icu.impl.OlsonTimeZone").newInstance();
I get:
13:07:31.031 - java.lang.ClassNotFoundException - in
D:\Development\Serebra\TESTtimezone\REMOTEicu4jTZ.cfc : line 60
com.ibm.icu.impl.OlsonTimeZone
I'm initializing things with:
tz=createObject("component","REMOTEicu4jTZ").init("D:\path\to\jarfile\TESTTimezone\icu4j- 3_6");
I'm new to calling Java classes as objects, so it's entirely
possible I've screwed something up. Anyone have any pointers, or
even tips on how to ask the right question?1) get & install mark's javaLoader CFC from
http://javaloader.riaforge.org/
2) get the newest timezoneCFC from
http://www.sustainablegis.com/projects/tz/testTZCFC.cfm
3) read the readme file & make the modifications to the
init method to point to
where you put the javaLoader CFC & icu4j jar (it probably
won't be named icu4j.jar). -
I tried importing the data from one schema to another but the Java classes that we use (via Java Stored Procedures) are showing up as invalid. Is there any reason why? We are using Oracle 10g R2. I tried resolving them by running the following sql, but that didn't work either:
ALTER JAVA CLASS "<java_clss>" RESOLVER (("*" <schema_name>)(* PUBLIC)) RESOLVE;
Any thoughts will be appreciated.There are two ways to instantiate a target's data. One is to use a native data loader or utility. In Oracle's case, Oracle Data Pump (not the "data pump" in GG) or SQL*Loader, as an example. The other way is to use GoldenGate's data pump.
You can configure DDL synchronization for Oracle, but you have to turn off the recycle bin. See Chapter 13 in the admin guide. -
GME PLLs, forms and java class files???
Hi,
if we generate forms of GME from adadmin PLLs will also get generated but how to compile java class files of a product GME ?
simply we need to create jar files?
RegardsHi,
if we generate forms of GME from adadmin PLLs will also get generated but how to compile java class files of a product GME ?No.
simply we need to create jar files?What do you mean by "create jar files"? Do you want to compile java classes? If yes, then the correct syntax is as follows:
SQL> ALTER JAVA CLASS "Object Name" RESOLVE;Regards,
Hussein -
(Class cast Exception)Problem while loading data fro database in java class
Dear all,
Please help me...to solve this
I have a database having two columns of String and Date Types.
In my java code i was trying to load the data to a UI.
I am successfull in loading the String type value.
But while loading date field value,is showing Class cast Exception.
What i am doing is Getting the values from database to a String[] array.
So my question is how to
get the Date field as date field itself,Then convert it to a String..Then put it in to String[] array...
Any body please help...If any one want more clarification in question i will give......Hi,
I am using GWT to display my data in a Grid.
So it will accept a Single two dimensional String array....Here i have one as String and other as Date.
So i was trying to get each row in a sindle dimensional array array[] then store it in a list.
Iteration goes up to 10 rows.After i am setting it in to a list
ie list.add(array);
Now while returning this list i am doing this
"return (String[][])list.toArray(new String[0][]);"
When i tried to get the date element to String array it is showing class cast exception. When i tried with toString() method it is showing the same problem. -
Was just wundering if it is possible to query a java jdo database with a swing frontend, and if so if anybody can direct me to any helpful websites.
CheersSure it is possible.
Do you know JDO? Googling for "JDO tutorial" should get you well on your way. Ditto for Swing / Swing tutorial.
Keep the database stuff and the GUI stuff in separate classes. That way you can write quickie command line main() functions to test a database method. Or, as you advance, you may want to learn about jUnit (->google).
There are application architecture issues that are mucho difficult to guess at without more details. Such as if your application is pretty big, you might want to look into some sort of client/server distributed architecture. But for simpler stuff, a single application should be a fine way to start. -
How can i run a program outside of Forte? (Forte and java/class files)
im making a program with forte... and i have a bunch of class files, i form file and a java file... how can i put these in one file so poeple without forte can run it...
thanksjmburns wrote:
I am trying to do a silent install of a program I built using LabVIEW 8.5. I also need to call an exe after the installation, so I am using the "run executable after installation" option on the Advanced tab of the installer. I then pass the following command lines to the setup.exe:
/qb /acceptlicenses yes /r
This installs the LabVIEW program successfully, but does not then run the additional exe afterward. If I run the setup.exe normally (with no command line parameters), the additional exe gets run.
Thanks,
Jason
This problem is fixed in a future release of LabVIEW. Here's the CAR ID 67549 for tracking purposes.
Message Edited by Bob P on 07-10-2008 09:10 AM
Maybe you are looking for
-
All, One machine running netscape and proxy. All requests are forwarded to the cluster. Two machines, one WL instance per. WL 510 SP4. All URLs go through NS/proxy. I can see the proxy round-robin the requests
-
How to store binary data in Java
I need to show news in my web aplication.So I am retrieving news from a Feed Server in which the field GEN_UNICODE_MESSAGE_1 gives the news data.News consists of both English/Arabic data.So how will I store the binary content in JAVA and how can I di
-
Limiting the number of records to be pooled from the database in DB adapter
Hi I am using Oracle SOA 11g and Jdeveloper 11.1.1.4 My requirement is i need to poll on a database and process the records. I have a primary key on which i can do the polling. My challenge over here is, I need to pick up one and only one record per
-
QA145 information msg to change error msg and will restrict PM order TECO ?
Dear All Guru's I have made necessary settings in control key PM01 type by selecting the checkbox indicator such as Inspection Characteristics and the same control key is used in Plant Maintenance- Calibration Order. Before completing UD, there is a
-
I can't seem to find a good music downloader for my iPad mini
Can anyone tell me a good music downloader for my iPad mini please?