[seasar-dotnet:1706] Re: [dbflute JDBCエラー]
kubo
[E-MAIL ADDRESS DELETED]
2010年 6月 7日 (月) 23:38:49 JST
Hello,
At first, DB settings are in App.config
// App.config example of dfnet-basic-example
https://www.seasar.org/svn/sandbox/dbflute.net/trunk/dfnet-basic-example/source/DfExampleTest/App.config
<quill>
<dataSources>
<dataSource name="xxx">
<provider>xxx</provider>
<connectionString>"xxx"</connectionString>
<class>Seasar.Extension.Tx.Impl.TxDataSource</class>
</dataSource>
</dataSources>
<assemblys>
<assembly>xxx</assembly>
</assemblys>
</quill>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
And there is an example of "ASP.NET + DBFlute.NET".
Please refer to the example, and you can get
a way to call those classes.
(Even if you don't use ASP.NET, it is so beneficial)
// dfnet-asp.net-example
https://www.seasar.org/svn/sandbox/dbflute.net/trunk/dfnet-asp.net-example
// MemberList.aspx.cs (uses QuillInjector at the constructor)
https://www.seasar.org/svn/sandbox/dbflute.net/trunk/dfnet-asp.net-example/source/DfExampleWeb/View/Member/MemberList.aspx.cs
// MemberFacade.cs (called by asp.net class and uses Behavior)
https://www.seasar.org/svn/sandbox/dbflute.net/trunk/dfnet-asp.net-example/source/DfExampleBiz/Facade/Member/MemberFacade.cs
Call-path is as follows:
MemberList.aspx
--> MemberFacade.cs
--> MemberBhv.cs
DBFlute.NET uses Quill.
It's simple DI container without setting files.
(similar to Google Guice in Java)
http://s2container.net.seasar.org/ja/quill.html
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberFacade and MemberBhv are DI component (of Quill).
If a class has an [Implementation] attribute, it means DI conponent.
[Implementation]
public class MemberFacade ...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
And MemberFacade.Update() method has a [Transaction] attribute.
It means the method is in transaction scope.
Only a DI component can use the [Transaction] attribute.
(And then the method must be virtual)
[Transaction]
public virtual void Update(MemberDto dto)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberList is not (cannot be) DI component
so MemberList needs to inject myself by QuillInjector
at the constructor for calling DI component classes.
protected MemberFacade facade; // injected by Inject(this);
public MemberList() {
QuillInjector.GetInstance().Inject(this);
}
protected void Page_Load(object sender, EventArgs e) {
... = facade.GetMemberList();
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thanks
jflute
2010/6/7 thomas <[E-MAIL ADDRESS DELETED]>:
> Hi,
>
> Now am able to create C# classes using dbflute with SQLServer.
> Now i want to use these classes in my application.
>
> What are the setting files i have to write for calling these classes.
> (like jdbc.dicon in java)
>
> Thanks in advance.
> Thomas
>
>
> 2010/6/5 kubo <[E-MAIL ADDRESS DELETED]>
>>
>> Hello thomas
>>
>> Please retry by dbflute-0.8.9.17-01-SNAPSHOT.zip.
>> You can get more detail messages of SQLException.
>>
>> Download it from this page:
>> http://dbflute.net.sandbox.seasar.org/ja/environment/newest.html
>>
>> Thanks
>> jflute
>> _______________________________________________
>> seasar-dotnet mailing list
>> [E-MAIL ADDRESS DELETED]
>> https://ml.seasar.org/mailman/listinfo/seasar-dotnet
>
>
> _______________________________________________
> seasar-dotnet mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-dotnet
>
>
seasar-dotnet メーリングリストの案内