由买买提看人间百态

topics

全部话题 - 话题: jdbc
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
c*****t
发帖数: 1879
1
Is it possible to create a database file through jdbc/odbc?
In the ODBC data source window, I see
MS Access Database
but, what is the url for creating database? I know that I
could create an empty access database before hand, and put
that file into the User Sources, but that's requires user
configuration, which is bad.
Anyone can help?
BTW, when I get an SQL exception such as
SQLException: [Microsoft][ODBC Microsoft Access Driver] Table 'COFFEES'
already exists.
Is the connection still
c*****n
发帖数: 1
2
来自主题: Java版 - jdbc连接数据库出现的问题
import java.sql.*;
public class MakingTheConnection {
public static void main(String[] args) {
try {
Class.forName("COM.cloudscape.core.JDBCDriver");
String sourceURL = "jdbc:cloudscape:C:/Music";
Connection databaseConnection =
DriverManager.getConnection(sourceURL);
System.out.println("Connection established successfully!");
databaseConnection.close();
}
catch (ClassNotFoundException cnfe) {
System.err.println(cnfe);
}
catch (SQLException sqle) {
System.err.println(sqle);
}
}
}
就这么一个小程序,我在clas
l***r
发帖数: 459
3
来自主题: Java版 - JDBC vs Application Server
We are really stuggling with keep using application server or use JDBC thin
connection directly. The main argument finally focused on "Transaction
Management". I wonder if I can get some advice or comparison from this list?
We mainly concern:
1) number of lines of code and code complexities
2) debuging time
3) developing time
4) maintainess
Btw, We don't care about "connection management" and "security management".
Thanks in advance!
q***e
发帖数: 90
4
来自主题: Java版 - JDBC vs Application Server
To be simple, whether you want 3-tier architecture or 2-tier
architecture?
Without an application server, using JDBC etc directly
skipped the EJB part. Two tier definitely works faster than
3 tier, but again you lose the scalability.
If you don't care distributed processing and scalability,
3-tier does not have much advantage. In terms of maintanence,
3-tier might be better, since change in front and backend are
seperated. Developing time and debuging time really depends on
th
l***r
发帖数: 459
5
来自主题: Java版 - JDBC vs Application Server
Thanks for your valuable opinions.
Since we cannot afford a big bugget, we don't have great debug tool on
application server. Based on my experience, I spend a lot of time on debuging
because I have to go through deploy-test-redeploy. It did hurt our development
time.
Also, I will be happier if I could hear your opinions on "transaction
management". Do you think JDBC can simply handle it prefectly? Or application
server have great advantage on that?
Thanks again!

thin
list?
management".
q***e
发帖数: 90
6
来自主题: Java版 - JDBC vs Application Server
You can have a good and free IDE for debug. Eclipse
is one of them, many commercial companies use this free
IDE for their development. It may take some effort to make
it work with different application server.
Yes, you can do transaction management with Just JDBC
perfectly. But it is up to you to write the code for
transaction management. With an application server, you
let the server do it for you. So if you have few and
simple transactions in your application, doing it yourself
by JD
g*******e
发帖数: 32
7
来自主题: Java版 - help for JDBC driver
I have installed Oracle to my computer.
How to setup the JDBC driver?
thanks very much.
s**o
发帖数: 584
8
来自主题: Java版 - help for JDBC driver
which version of Oracle?
check your Oralce_HOme\jdbc for the installation.
You only have to add two files in to classpath.
p***n
发帖数: 635
9
来自主题: Java版 - MS SQL Server JDBC Driver Problem
I am using MS SQL SERVER JDBC DRIVER under Weblogic 7 to call an MS SQL Server
stored procedure. The stored procedure returns a xml string like this:

...
...
...

so far so good.
the problem comes up when there is some characters like "'" is contained in
the string, e.g.,
Let's go and have fun
Then the SP call returns some funky character which XALAN is not able to
parse.
Tried to execute the SP from SQL Server client and the result returned is
fine.
A
f********h
发帖数: 149
10
来自主题: Java版 - JDBC & Firewall
it seems the jvm can't find the jdbc driver. make sure it is in your classpath.
x***e
发帖数: 30
11
来自主题: Java版 - question about install jdbc
I download jdbc driver for oracle on oracle website. it is a .zip file. I
don't know how I can make it work, I unziped it to the java folder, it doesn't
work.
ggjj ddmm, give me a hand. I am too Cai, too Cai.
t********k
发帖数: 808
12
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.ejb.*;
import javax.sql.*;
import weblogic.ejb.*;
import weblogic.jdbc.vendor.oracle.*;
private String updateBulletinReply(BulletinReplyInfo bulletinReplyInfo)
{
if (bulletinReplyInfo == null)
{
return null;
}

try
{
pts = con.prepareStatement(sql);
pts.setString(1,bulletinReplyInfo.getReplyManID());
pts.setTimestamp(2,new
t********k
发帖数: 808
13
我加载了Oracle 9i自带的的JDBC包
m******y
发帖数: 588
14
来自主题: Java版 - jdbc问题一问
You can use DSNless connection so that you don't need to add the connection in ODBC in
Control Pane every time.
The code is like this if the Access file is test.mdb:
import java.sql.*;
public class ConnectionDB
{
static String filename = "test.mdb";
static String database = "jdbc:odbc:Driver={Microsoft Access Driver
(*.mdb)};DBQ=";
static Connection aConnection;
static Statement aStatement;
// establish the database connection
public static void initialize()
a***n
发帖数: 1616
15
用JDBC,最基本的数据库连接访问。开始还是好的。
过了一段时间后,就报错,说用完了shared memory,全被heap占用了。
网上说,要增加large pool size。
可是,我看了pool里的free memory,随着我程序的不断数据库访问,
它占用的pool memory是成递增的,最后就满了fail了。
所以,按这个趋势,无论我pool设多大,memory终究是要溢出的。。。
(我的large pool size已经是80M多了, 我也就做了一些简单的数据库访问而已)
我想是我java程序的问题。是不是要用shared sql? 让所有数据库访问用shared资源?
或者让已经做完的数据库操作把占用的heap dump掉?
这该到底怎么做啊。。。。?
谢了!
w*********y
发帖数: 28
16
我想用JDBC往数据库里插入几条记录,但每次执行到executeUpdate(...),程序就死住了
。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
atement也不行,反正我能想到的都试过了。----有人说是内存溢出,但是只插入一条记
录,怎么会溢出呢?
请问各位有没有遇到类似这样的问题,如何解决?BTW,我用的是Oracle, 以前从来没问
题的。
w*********y
发帖数: 28
17
多谢各位大侠的指教,你们提出的方法我也都试过了!比如在SQLPLUS下执行我要执行的S
QL语句。
十分怪异的是,我打印出我要执行的语句,copy到SQLPLUS, 在SQLPLUS下执行完全正确
!!!我想补充的是,如果建立table时,没有REFERENCES,就可以正常插入;有了REFER
ENCES,就出现deadlock的问题。
因此合理解释是:我要执行的SQL语句无误,也没有constraint的问题。 出现问题只可能

1. Oracle JDBC的bug。
2. 系统没有给我足够的权限!---但怎么知道系统给了我什么权限呢?
这次出现的deadlock的问题真的不能catch到,实在太古怪了,我周围没有一个人能解释
。多谢各位了!

the

。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
it
U*O
发帖数: 2342
18
想通过JDBC从本地机器(XP)连到服务器的数据库(Oracle9i)进行数据操作。
请问本地机器应该安装什么开发环境?
-j2eesdk 还是 jdk tm?
-driver怎么办?
谢谢
r*****l
发帖数: 2859
19
1. install j2se
2. install oracle client.
3. put classes111.zip and classes12.zip in your classpath. JDBC drivers
are in these files.
m**c
发帖数: 90
20

FYI: If you are using JDK 1.4 and above, the JDBC driver (for 9i) is not
classes12.zip anymore, it is "ojdbc14.jar". Check "What are all of these
files for?" at
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
b*****o
发帖数: 284
21
来自主题: Java版 - JDBC怎样连接FoxPro数据库?
JDBC怎样连接FoxPro数据库?
g*s
发帖数: 2277
22
来自主题: Java版 - JDBC怎样连接FoxPro数据库?
JDBC-ODBC bridge
l*****e
发帖数: 1431
23
来自主题: Java版 - 自己写一个Oracle的JDBC driver
打算自己写一个oracle的type 3 or type 4 jdbc driver, 就不要问为什么要自己写了,
原因很复杂,但是从oracle的网站上找不到API的doc, 谁能指点一下?还是Oracle的API
是不公开的
c*****s
发帖数: 214
24
来自主题: Java版 - 自己写一个Oracle的JDBC driver
虽然没有烟酒过,不过我深信你是找不到源码的。
虽然你说不要问为什么自己写,但我实在想不出有什么理由不能用oracle提供的包。何况
给任何一个数据库写个jdbc driver都不是件容易的事儿。


谁能指点一下?还是Oracle的API
m******t
发帖数: 2416
25
来自主题: Java版 - 自己写一个Oracle的JDBC driver

JDBC
type
by
So all you need is the Oracle CLI spec, which I'd be surprised if you can't
find in Oracle documentation.
sigh, like other folks I guess I just can't help with this - you don't have to
answer - "why? why? why?!" 8-)

谁能指点一下?还是Oracle的
l*****e
发帖数: 1431
26
来自主题: Java版 - 自己写一个Oracle的JDBC driver

specified
to
The reason is rather stupid and i feel kinda embarassed to say :) the bright
side is I don't have to implement all the JDBC API's spec'd by Sun which seems
to be a daunting task. I googled 'oracle cli api' and tried to find it on it's
website but nothing turned out. Care to shed some light on where I might be
getting the info? Thanks in advance
c*****s
发帖数: 214
27
Error Trace in getConnection() : [Microsoft][SQLServer 2000 Driver for
JDBC]Error establishing socket.
Error: No active Connection
看上去不是Driver的问题。先拿SQLserver自己的客户端连连看。
顺便提一句,我很难接受使用ms写的java程序,看到com.microsoft, com.ms这样的包就
有做呕的感觉,谁知道里面有没有平台相关的代码。建议你用http://jtds.sourceforge.
net/

why
t*****s
发帖数: 124
28
如果是jdbc 3.0,可以支持检索自动产生的key
ResultSet rs = stmt.getGeneratedKeys()
if (rs.netx())
{
int key = rs.getInt();
}
f*******4
发帖数: 345
29
I tried DatabaseMetaData.getTables(catalog, schema, "%", new String[]{"TABLE
"}) and got nothing.
I used ResultSetMetaData.getSchemaName(column) and got an empty String.
Anything wrong with the code or Oracle 9i JDBC driver hasn't implemented
those APIs properly?
g***l
发帖数: 352
30
来自主题: Java版 - JDBC
有了spring/hibernate,还有人直接用JDBC写database application code吗?
r*****l
发帖数: 2859
31
来自主题: Java版 - JDBC
This always comes down to flexibility vs standard/convention. A real good
developer can take advantage of straight JDBC's flexibility and write good
code that outperforms Hibernate. However, real good developers are rare and
for most of us, using Hibernate will yield better results.
m******e
发帖数: 1293
32
来自主题: Java版 - JDBC
Jdbc's batch update /insert /delete is way faster than hibernate
g***l
发帖数: 352
33
来自主题: Java版 - JDBC
有了spring/hibernate,还有人直接用JDBC写database application code吗?
r*****l
发帖数: 2859
34
来自主题: Java版 - JDBC
This always comes down to flexibility vs standard/convention. A real good
developer can take advantage of straight JDBC's flexibility and write good
code that outperforms Hibernate. However, real good developers are rare and
for most of us, using Hibernate will yield better results.
m******e
发帖数: 1293
35
来自主题: Java版 - JDBC
Jdbc's batch update /insert /delete is way faster than hibernate
T*********g
发帖数: 496
36
来自主题: Java版 - JDBC
If you really got lots of data, why you consider jdbc? Normally, Db provides
some tools to load the data from some specific format file automatically,
which will increase the performance dramatically.
h**********c
发帖数: 4120
37
来自主题: Java版 - jdbc connection timeout ?
the question:
Sun has a jdbc pool example. I implement the interfaces.
The connections time out overnight.
It is not recommended to use auto-reconnect. why? the key point is I don't
know how to set auto-reconnect.
Or there is better solution.
Put simple,
how to check java.sql.connection valid? It is has abstract function isValid,
but how to overwrite it? if not valid, how to reconnect?
Thanks in advance.
c******n
发帖数: 4965
38
I would need to replicate all the tables used in my project to another DB,
which has less background load,
the existing project uses a combination of JDBC and hibernate, with
hibernate being the majority.
I guess I COULD scrape hibernate query logs and find the tables accessed,
but that presents problems since in the test or production, the test data
may omit some access patterns.
is there some code analysis tool to generate all the tables accessed by a
hibernate project?
r*****s
发帖数: 985
39
好像要么是HTTP Session,
要么是Hibernate里的Session, bounded by a tx.
JDBC好像没有这个概念?
B*****g
发帖数: 34098
40
俺说的是oracle里的session,jdbc怎么连的?

But
transaction
r*****s
发帖数: 985
41
这个好像depends on the jdbc driver
对于java code来说就是个parameter吧?
e*****t
发帖数: 1005
42
jdbc没有session概念的,只有connection,然后对于connection,有transaction的问题。
所以,如果你是different threads,dealing with the same connection. 你需要考虑
的是transaction的问题。
T*******x
发帖数: 8565
43
比如在一个函数内部,connection是一个local variable。
函数结束的时候为什么不自动释放jdbc connection?
做不到吗?内部有什么难度吗?
g*****g
发帖数: 34805
44
OK, you are probably right. I haven't done raw jdbc in years. Application
server always use a connection pool and you don't really want to open a
connection every time.
b******y
发帖数: 9224
45

en, 我没说清楚。是没啥东西了。
底层我们用的是Apache的multi-threaded object pooling library. 就是用来做jdbc
connection的那一层。
w**z
发帖数: 8232
46
dbcp ?

jdbc
l*******n
发帖数: 35
47
请益:
有个稀疏表,11万行,100列。每行大概1~10个数据,位置不定其余都是null
要数据处理,把数据都读一遍,需要读出value 和相应 column name
用jdbc分批读,发现读入resultset之后遍历要花40分钟。
纯用stored procedure读会不会效率高点?
l*******n
发帖数: 35
48
已经batch读了 现在每次1k row,处理完再JDBC prepared statement读
遍历这1k row x 100 columns,结果放一个> map里 要22秒
不过是在本机跑的还没放server上测试
b***i
发帖数: 3043
49
其中blob就是Sql的Blob。结果发现,数据库里面的文件不对,变长了,看起来是被utf
-8给编码了。比如数据开始原来是
ff d8 ff e0-00 10 4a 46,结果变成
ef bf bd ef-bf bd ef bf-bd ef bf bd-00 10 4a 46
我是让数据库把所有通讯都utf-8了,在 spring-servlet.xml里面
jdbc:mysql://10.0.16.16:4066/mysql?useEncoding=true&characterEncoding=
UTF-8"
请问如何才能正确insert?
r****z
发帖数: 18
50
来自主题: Programming版 - 急问:Oracle JDBC 问题
怎样import Oracle的JDBC Driver class? 系统及软件设置如下:
Windows XP, 已装了JDK 6和Oracle Express 10g. 写了个Java小程序,前面几行是:
import java.sql.*;
import oracle.*;
import oracle.pool.OracleDataSource;
javac 就是不认oracle.*和oracle.pool.OracleDataSource。我已经从Oracle网站上下
载了ojdbc6.jar并存于当前目录(放源文件的目录)。我也试了将CLASSPATH改成当前
目录或者在命令行直接输入。这些都不行,到底怎么回事啊?
恳请高人执教!
叩谢!
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)